diff options
author | Étienne Loks <etienne.loks@iggdrasil.net> | 2020-03-10 12:13:12 +0100 |
---|---|---|
committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2020-03-10 12:31:16 +0100 |
commit | 9a7d51fe1c67bad74b6463c6f935ef1ee8e67ffa (patch) | |
tree | 19d5bc7e1055c044cc5e5c3276259ddb678d88ec /archaeological_warehouse/models.py | |
parent | 23ba560e667cd856a7ee11939420afbee8d15d72 (diff) | |
download | Ishtar-9a7d51fe1c67bad74b6463c6f935ef1ee8e67ffa.tar.bz2 Ishtar-9a7d51fe1c67bad74b6463c6f935ef1ee8e67ffa.zip |
Search fields for containers and warehouse
Containers:
- find: ID, label
- operation: town, scientist
Warehouse:
- town
Diffstat (limited to 'archaeological_warehouse/models.py')
-rw-r--r-- | archaeological_warehouse/models.py | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/archaeological_warehouse/models.py b/archaeological_warehouse/models.py index 89c208df8..75a3deda0 100644 --- a/archaeological_warehouse/models.py +++ b/archaeological_warehouse/models.py @@ -83,6 +83,11 @@ class Warehouse(Address, DocumentItem, GeoItem, QRCodeItem, DashboardFormItem, pgettext_lazy("key for text search", "type"), 'warehouse_type__label__iexact' ), + 'town': + SearchAltName( + pgettext_lazy("key for text search", "town"), + 'precise_town__cached_label__iexact' + ), } GEO_LABEL = "name" DOWN_MODEL_UPDATE = ["containers"] @@ -496,6 +501,18 @@ class Container(DocumentItem, LightHistorizedItem, QRCodeItem, GeoItem, pgettext_lazy("key for text search", "comment"), 'comment__iexact' ), + 'operation_town': + SearchAltName( + pgettext_lazy("key for text search", "operation-town"), + 'finds__base_finds__context_record__operation__' + 'towns__cached_label__iexact' + ), + 'operation_scientist': + SearchAltName( + pgettext_lazy("key for text search", "operation-scientist"), + 'finds__base_finds__context_record__operation__' + 'scientist__cached_label__iexact' + ), 'code_patriarche': SearchAltName( pgettext_lazy("key for text search", "code-patriarche"), @@ -527,6 +544,14 @@ class Container(DocumentItem, LightHistorizedItem, QRCodeItem, GeoItem, SearchAltName( pgettext_lazy("key for text search", "context-record"), 'finds__base_finds__context_record__cached_label__icontains'), + 'find_label': + SearchAltName( + pgettext_lazy("key for text search", "find-label"), + 'finds__label__icontains'), + 'find_denomination': + SearchAltName( + pgettext_lazy("key for text search", "find-denomination"), + 'finds__denomination__icontains'), 'material_types': SearchAltName( pgettext_lazy("key for text search", "material"), |