diff options
author | Étienne Loks <etienne.loks@iggdrasil.net> | 2017-09-21 18:19:06 +0200 |
---|---|---|
committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2017-09-21 18:19:06 +0200 |
commit | db31e48eeef75a4eb24e7170cdd97c0c84d6234a (patch) | |
tree | d9ae5b85b6a6e50a51c473679ba90dc9a8f21526 | |
parent | 73e7574e1d3aa096e3a0e8fa17d4d89ab1219353 (diff) | |
download | Ishtar-db31e48eeef75a4eb24e7170cdd97c0c84d6234a.tar.bz2 Ishtar-db31e48eeef75a4eb24e7170cdd97c0c84d6234a.zip |
Add object type as a hierarchical search (refs #3742)
-rw-r--r-- | archaeological_finds/models_finds.py | 5 | ||||
-rw-r--r-- | ishtar_common/views.py | 4 |
2 files changed, 6 insertions, 3 deletions
diff --git a/archaeological_finds/models_finds.py b/archaeological_finds/models_finds.py index a335eb6ec..811e6be74 100644 --- a/archaeological_finds/models_finds.py +++ b/archaeological_finds/models_finds.py @@ -503,7 +503,7 @@ class Find(BulkUpdatedItem, ValueGetter, BaseHistorizedItem, ImageModel, 'base_finds__context_record__operation__common_name', 'base_finds__context_record__parcel', 'base_finds__context_record__label', - 'material_types__label', 'object_types', + 'material_types__label', 'object_types__label', 'datings__period__label', 'container__cached_label', 'base_finds__batch', ] @@ -514,7 +514,7 @@ class Find(BulkUpdatedItem, ValueGetter, BaseHistorizedItem, ImageModel, 'base_finds__cache_short_id', 'base_finds__cache_complete_id', 'previous_id', 'label', 'material_types__label', - 'datings__period__label', 'find_number', 'object_types', + 'datings__period__label', 'find_number', 'object_types__label', 'container__cached_label', 'description', 'base_finds__context_record__parcel__town', @@ -541,6 +541,7 @@ class Find(BulkUpdatedItem, ValueGetter, BaseHistorizedItem, ImageModel, 'container__cached_label': _(u"Container"), 'datings__period__label': _(u"Periods"), 'material_types__label': _(u"Material types"), + 'object_types__label': _(u"Object types"), } EXTRA_FULL_FIELDS = [ diff --git a/ishtar_common/views.py b/ishtar_common/views.py index 0ee57364b..997acd7df 100644 --- a/ishtar_common/views.py +++ b/ishtar_common/views.py @@ -587,7 +587,7 @@ def format_val(val): HIERARCHIC_LEVELS = 5 HIERARCHIC_FIELDS = ['periods', 'period', 'unit', 'material_types', - 'material_type', 'conservatory_state'] + 'material_type', 'conservatory_state', 'object_types'] def _get_values(request, val): @@ -677,6 +677,7 @@ def get_item(model, func_name, default_name, extra_request_keys=[], fields = [model._meta.get_field(k) for k in get_all_field_names(model)] + request_keys = dict([ (field.name, field.name + (hasattr(field, 'rel') and field.rel and '__pk' @@ -733,6 +734,7 @@ def get_item(model, func_name, default_name, extra_request_keys=[], q = Q(**{req_key: val}) reqs |= q and_reqs.append(reqs) + pinned_search = "" if 'submited' not in request_items and full != 'shortcut': # default search |