diff options
author | Étienne Loks <etienne.loks@iggdrasil.net> | 2024-09-17 09:59:33 +0200 |
---|---|---|
committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2024-09-17 10:04:54 +0200 |
commit | 0e22d62ec2cacfe501bdb7a4f3afde9081366d55 (patch) | |
tree | e4028524c840613a9e81eec3510c51f670ccb44e /ishtar_common/views_item.py | |
parent | 034e7bb7af624f92e1a3a2f27370ba8e671f05ac (diff) | |
download | Ishtar-0e22d62ec2cacfe501bdb7a4f3afde9081366d55.tar.bz2 Ishtar-0e22d62ec2cacfe501bdb7a4f3afde9081366d55.zip |
✨ context record search: manage new fields (refs #6024)
Diffstat (limited to 'ishtar_common/views_item.py')
-rw-r--r-- | ishtar_common/views_item.py | 97 |
1 files changed, 50 insertions, 47 deletions
diff --git a/ishtar_common/views_item.py b/ishtar_common/views_item.py index 2a35c85d2..728822f0c 100644 --- a/ishtar_common/views_item.py +++ b/ishtar_common/views_item.py @@ -99,6 +99,56 @@ CURRENT_ITEM_KEYS = ( ) CURRENT_ITEM_KEYS_DICT = dict(CURRENT_ITEM_KEYS) +HIERARCHIC_LEVELS = 5 + +LIST_FIELDS = { # key: hierarchic depth + "conservatory_states": HIERARCHIC_LEVELS, + "identifications": HIERARCHIC_LEVELS, + "material_types": HIERARCHIC_LEVELS, + "material_type": HIERARCHIC_LEVELS, + "object_types": HIERARCHIC_LEVELS, + "period": HIERARCHIC_LEVELS, + "periods": HIERARCHIC_LEVELS, + "source_type": HIERARCHIC_LEVELS, + "unit": HIERARCHIC_LEVELS, + "museum_collection_entry_mode": HIERARCHIC_LEVELS, + "shooting_angle": HIERARCHIC_LEVELS, + "technical_processes": HIERARCHIC_LEVELS, + "structures": HIERARCHIC_LEVELS, + "textures": HIERARCHIC_LEVELS, + "inclusions": HIERARCHIC_LEVELS, + "colors": HIERARCHIC_LEVELS, + "museum_inventory_marking_presence": 0, + "museum_marking_type": 0, + "museum_collection": 0, + "batch": 0, + "preservation_to_considers": 0, + "integrities": 0, + "remarkabilities": 0, + "checked_type": 0, + "material_type_quality": 0, + "object_type_quality": 0, + "communicabilities": 0, + "alterations": 0, + "alteration_causes": 0, + "treatment_emergency": 0, + "cultural_attributions": 0, + "remains": 0, + "dating_type": 0, + "quality": 0, + "operation_type": 0, + "report_processing": 0, + "record_quality_type": 0, + "data_type": 0, + "origin": 0, + "provider": 0, + "excavation_technics": 0, + "activity": 0, + "documentations": 0, +} + +HIERARCHIC_FIELDS = list(LIST_FIELDS.keys()) + def get_autocomplete_queries(request, label_attributes, extra=None): if not label_attributes: @@ -557,53 +607,6 @@ def revert_item(model): return func -HIERARCHIC_LEVELS = 5 - -LIST_FIELDS = { # key: hierarchic depth - "conservatory_states": HIERARCHIC_LEVELS, - "identifications": HIERARCHIC_LEVELS, - "material_types": HIERARCHIC_LEVELS, - "material_type": HIERARCHIC_LEVELS, - "object_types": HIERARCHIC_LEVELS, - "period": HIERARCHIC_LEVELS, - "periods": HIERARCHIC_LEVELS, - "source_type": HIERARCHIC_LEVELS, - "unit": HIERARCHIC_LEVELS, - "museum_collection_entry_mode": HIERARCHIC_LEVELS, - "shooting_angle": HIERARCHIC_LEVELS, - "technical_processes": HIERARCHIC_LEVELS, - "museum_inventory_marking_presence": 0, - "museum_marking_type": 0, - "museum_collection": 0, - "batch": 0, - "preservation_to_considers": 0, - "integrities": 0, - "remarkabilities": 0, - "checked_type": 0, - "material_type_quality": 0, - "object_type_quality": 0, - "communicabilities": 0, - "alterations": 0, - "alteration_causes": 0, - "treatment_emergency": 0, - "cultural_attributions": 0, - "remains": 0, - "dating_type": 0, - "quality": 0, - "operation_type": 0, - "report_processing": 0, - "record_quality_type": 0, - "data_type": 0, - "origin": 0, - "provider": 0, - "excavation_technics": 0, - "activity": 0, - "documentations": 0, -} - -HIERARCHIC_FIELDS = list(LIST_FIELDS.keys()) - - def _get_values(request, val): if hasattr(val, "all"): # manage related objects vals = list(val.all()) |