diff options
author | Étienne Loks <etienne.loks@iggdrasil.net> | 2024-07-09 11:53:00 +0200 |
---|---|---|
committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2024-07-09 11:53:00 +0200 |
commit | 915e294bcacf7bf79c90fc7ffb46f34d3902aaec (patch) | |
tree | 1e8aab73d44e23139571665e35cd722ed3afca28 /archaeological_finds | |
parent | d7effe6fae485d3b2d4bfbe1315bd3acf1d85e41 (diff) | |
download | Ishtar-915e294bcacf7bf79c90fc7ffb46f34d3902aaec.tar.bz2 Ishtar-915e294bcacf7bf79c90fc7ffb46f34d3902aaec.zip |
🐛 fix many date and numeric searches (refs #5928)
Diffstat (limited to 'archaeological_finds')
5 files changed, 34 insertions, 53 deletions
diff --git a/archaeological_finds/fixtures/initial_data-fr.json b/archaeological_finds/fixtures/initial_data-fr.json index 91c8c0c91..4b0c75553 100644 --- a/archaeological_finds/fixtures/initial_data-fr.json +++ b/archaeological_finds/fixtures/initial_data-fr.json @@ -7036,7 +7036,7 @@ "model": "archaeological_finds.treatmentfiletype", "fields": { "label": "Demande de pr\u00eat pour exposition", - "txt_idx": "loan_demand_exposure", + "txt_idx": "loan-for-exhibition", "comment": "", "available": true } diff --git a/archaeological_finds/migrations/0126_fix_treatment_file_exhibition.py b/archaeological_finds/migrations/0126_fix_treatment_file_exhibition.py new file mode 100644 index 000000000..f9d252e0d --- /dev/null +++ b/archaeological_finds/migrations/0126_fix_treatment_file_exhibition.py @@ -0,0 +1,21 @@ +# Generated by Django 2.2.24 on 2024-07-09 11:11 + +from django.db import migrations + + +SQL = """ +UPDATE archaeological_finds_treatmentfiletype + SET txt_idx='loan-for-exhibition' + WHERE txt_idx='loan_demand_exposure' +""" + + +class Migration(migrations.Migration): + + dependencies = [ + ('archaeological_finds', '0125_data_migration_communicability_functionalarea'), + ] + + operations = [ + migrations.RunSQL(SQL) + ] diff --git a/archaeological_finds/models_finds.py b/archaeological_finds/models_finds.py index 5f8c30701..68c988517 100644 --- a/archaeological_finds/models_finds.py +++ b/archaeological_finds/models_finds.py @@ -1241,7 +1241,7 @@ class Find( } DATED_FIELDS = BaseHistorizedItem.DATED_FIELDS + [ - "treatments__file__end_date", + "basket__treatment_files__end_date", "treatments__end_date", "base_finds__discovery_date", "base_finds__discovery_date_taq", @@ -1264,11 +1264,16 @@ class Find( "circumference", "volume", "weight", + "find_number", + "min_number_of_individuals", + "datings__start_date", + "datings__end_date", "clutter_long_side", "clutter_short_side", "clutter_height", - "estimated_value", - "insurance_value", + "museum_inventory_entry_year", + "museum_inventory_quantity", + "museum_observed_quantity", ] + GeographicSubTownItem.NUMBER_FIELDS BASE_REQUEST = {"downstream_treatment__isnull": True} EXTRA_REQUEST_KEYS = { @@ -1443,7 +1448,7 @@ class Find( "loan": SearchAltName(pgettext_lazy("key for text search", "loan"), query_loan), "treatments_file_end_date": SearchAltName( pgettext_lazy("key for text search", "treatment-file-end-date"), - "treatments__file__end_date", + "basket__treatment_files__end_date", ), "treatments_end_date": SearchAltName( pgettext_lazy("key for text search", "treatment-end-date"), @@ -1531,43 +1536,6 @@ class Find( pgettext_lazy("key for text search", "conservatory-comment"), "conservatory_comment__iexact", ), - "length__lower": SearchAltName( - pgettext_lazy("key for text search", "length-lower"), "length__lte" - ), - "width__lower": SearchAltName( - pgettext_lazy("key for text search", "width-lower"), "width__lte" - ), - "height__lower": SearchAltName( - pgettext_lazy("key for text search", "height-lower"), "height__lte" - ), - "thickness__lower": SearchAltName( - pgettext_lazy("key for text search", "thickness-lower"), "thickness__lte" - ), - "diameter__lower": SearchAltName( - pgettext_lazy("key for text search", "diameter-lower"), "diameter__lte" - ), - "circumference__lower": SearchAltName( - pgettext_lazy("key for text search", "circumference-lower"), - "circumference__lte", - ), - "volume__lower": SearchAltName( - pgettext_lazy("key for text search", "volume-lower"), "volume__lte" - ), - "weight__lower": SearchAltName( - pgettext_lazy("key for text search", "weight-lower"), "weight__lte" - ), - "clutter_long_side__lower": SearchAltName( - pgettext_lazy("key for text search", "clutter-long-side-lower"), - "clutter_long_side__lte", - ), - "clutter_short_side__lower": SearchAltName( - pgettext_lazy("key for text search", "clutter-short-side-lower"), - "clutter_short_side__lte", - ), - "clutter_height__lower": SearchAltName( - pgettext_lazy("key for text search", "clutter-height-lower"), - "clutter_height__lte", - ), "length": SearchAltName( pgettext_lazy("key for text search", "length"), "length" ), @@ -1702,7 +1670,7 @@ class Find( pgettext_lazy("key for text search", "museum-custodian-institution"), "museum_custodian_institution__name__iexact", related_name="museum_custodian_institution" - ), + ), "museum_depositor_inventory_number": SearchAltName( pgettext_lazy("key for text search", "museum-depositor-inventory-number"), "museum_depositor_inventory_number__iexact" @@ -1782,11 +1750,11 @@ class Find( ), "museum_inventory_quantity": SearchAltName( pgettext_lazy("key for text search", "museum-inventory-quantity"), - "museum_inventory_quantity__iexact" + "museum_inventory_quantity" ), "museum_observed_quantity": SearchAltName( pgettext_lazy("key for text search", "museum-observed-quantity"), - "museum_observed_quantity__iexact" + "museum_observed_quantity" ), } ALT_NAMES.update(BaseHistorizedItem.ALT_NAMES) diff --git a/archaeological_finds/templates/ishtar/sheet_find.html b/archaeological_finds/templates/ishtar/sheet_find.html index c0f525dfa..27d106fbd 100644 --- a/archaeological_finds/templates/ishtar/sheet_find.html +++ b/archaeological_finds/templates/ishtar/sheet_find.html @@ -48,7 +48,6 @@ {% trans "Identification / Description" %} </a> </li> - {% if display_warehouse_treatments %} <li class="nav-item"> <a class="nav-link" id="{{window_id}}-warehouse-tab" data-toggle="tab" href="#{{window_id}}-warehouse" role="tab" @@ -56,7 +55,6 @@ {% trans "Preservation / Treatments" %} </a> </li> - {% endif %} {% if display_documents %} <li class="nav-item"> <a class="nav-link" id="{{window_id}}-documents-tab" @@ -271,7 +269,6 @@ {% include "ishtar/blocks/sheet_creation_section.html" %} </div> </div> - {% if display_warehouse_treatments %} <div class="tab-pane fade" id="{{window_id}}-warehouse" role="tabpanel" aria-labelledby="{{window_id}}-warehouse-tab"> {% comment %} @@ -529,7 +526,6 @@ </table> {% endif %} </div> - {% endif %} {% if display_documents %} <div class="tab-pane fade" id="{{window_id}}-documents" role="tabpanel" aria-labelledby="{{window_id}}-documents-tab"> diff --git a/archaeological_finds/templates/ishtar/sheet_museum_find.html b/archaeological_finds/templates/ishtar/sheet_museum_find.html index 4006973d7..73e76d8bd 100644 --- a/archaeological_finds/templates/ishtar/sheet_museum_find.html +++ b/archaeological_finds/templates/ishtar/sheet_museum_find.html @@ -48,7 +48,6 @@ {% trans "Archaeological context" %} </a> </li> - {% if display_warehouse_treatments %} <li class="nav-item"> <a class="nav-link" id="{{window_id}}-warehouse-tab" data-toggle="tab" href="#{{window_id}}-warehouse" role="tab" @@ -56,7 +55,6 @@ {% trans "Preservation / Treatments" %} </a> </li> - {% endif %} {% if display_documents %} <li class="nav-item"> <a class="nav-link" id="{{window_id}}-documents-tab" @@ -297,7 +295,6 @@ </div> </div> - {% if display_warehouse_treatments %} <div class="tab-pane fade" id="{{window_id}}-warehouse" role="tabpanel" aria-labelledby="{{window_id}}-warehouse-tab"> {% comment %} @@ -555,7 +552,6 @@ </table> {% endif %} </div> - {% endif %} {% if display_documents %} <div class="tab-pane fade" id="{{window_id}}-documents" role="tabpanel" aria-labelledby="{{window_id}}-documents-tab"> |