diff options
author | Étienne Loks <etienne.loks@iggdrasil.net> | 2018-08-16 18:27:22 +0200 |
---|---|---|
committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2018-08-16 18:27:22 +0200 |
commit | 4dfc239a465d5130180038bc1bf7f036ba307831 (patch) | |
tree | 7859e2fcc08787d41a4d65db3721006bc5554c13 /archaeological_finds | |
parent | fbff9e5ffda34efd195a27ddfd8f519a2dade042 (diff) | |
download | Ishtar-4dfc239a465d5130180038bc1bf7f036ba307831.tar.bz2 Ishtar-4dfc239a465d5130180038bc1bf7f036ba307831.zip |
Search: manage open search
Diffstat (limited to 'archaeological_finds')
-rw-r--r-- | archaeological_finds/models_finds.py | 33 | ||||
-rw-r--r-- | archaeological_finds/models_treatments.py | 8 |
2 files changed, 21 insertions, 20 deletions
diff --git a/archaeological_finds/models_finds.py b/archaeological_finds/models_finds.py index 40bcf52c7..41752be0b 100644 --- a/archaeological_finds/models_finds.py +++ b/archaeological_finds/models_finds.py @@ -720,19 +720,19 @@ class Find(BulkUpdatedItem, ValueGetter, BaseHistorizedItem, OwnPerms, ALT_NAMES = { 'base_finds__cache_short_id': ( pgettext_lazy("key for text search", u"short-id"), - 'base_finds__cache_short_id__contains' + 'base_finds__cache_short_id__iexact' ), 'base_finds__cache_complete_id': ( pgettext_lazy("key for text search", u"complete-id"), - 'base_finds__cache_complete_id__icontains' + 'base_finds__cache_complete_id__iexact' ), 'label': ( pgettext_lazy("key for text search", u"free-id"), - 'label__icontains' + 'label__iexact' ), 'denomination': ( pgettext_lazy("key for text search", u"denomination"), - 'denomination__icontains' + 'denomination__iexact' ), 'base_finds__context_record__town': ( pgettext_lazy("key for text search", u"town"), @@ -748,7 +748,7 @@ class Find(BulkUpdatedItem, ValueGetter, BaseHistorizedItem, OwnPerms, ), 'base_finds__context_record__operation__code_patriarche': ( pgettext_lazy("key for text search", u"code-patriarche"), - 'base_finds__context_record__operation__code_patriarche' + 'base_finds__context_record__operation__code_patriarche__iexact' ), 'base_finds__context_record__operation__operation_type': ( pgettext_lazy("key for text search", u"operation-type"), @@ -811,7 +811,7 @@ class Find(BulkUpdatedItem, ValueGetter, BaseHistorizedItem, OwnPerms, ), 'base_finds__find__description': ( pgettext_lazy("key for text search", u"description"), - 'base_finds__find__description__icontains', + 'base_finds__find__description__iexact', ), 'base_finds__batch': ( pgettext_lazy("key for text search", u"batch"), @@ -848,6 +848,17 @@ class Find(BulkUpdatedItem, ValueGetter, BaseHistorizedItem, OwnPerms, EXTRA_REQUEST_KEYS[unicode(v[0])] = v[1] deactivate() + PARENT_SEARCH_VECTORS = ['base_finds'] + BASE_SEARCH_VECTORS = [ + "cached_label", "label", "description", "container__location__name", + "container__reference", "mark", "comment", "dating_comment", + "previous_id", "denomination", "museum_id", "decoration", + "manufacturing_place" + ] + M2M_SEARCH_VECTORS = [ + "datings__period__label", "object_types__label", "integrities__label", + "remarkabilities__label", "material_types__label"] + # fields base_finds = models.ManyToManyField(BaseFind, verbose_name=_(u"Base find"), related_name='find') @@ -978,16 +989,6 @@ class Find(BulkUpdatedItem, ValueGetter, BaseHistorizedItem, OwnPerms, db_index=True) history = HistoricalRecords() BASKET_MODEL = FindBasket - PARENT_SEARCH_VECTORS = ['base_finds'] - BASE_SEARCH_VECTORS = [ - "cached_label", "label", "description", "container__location__name", - "container__reference", "mark", "comment", "dating_comment", - "previous_id", "denomination", "museum_id", "decoration", - "manufacturing_place" - ] - M2M_SEARCH_VECTORS = [ - "datings__period__label", "object_types__label", "integrities__label", - "remarkabilities__label", "material_types__label"] class Meta: verbose_name = _(u"Find") diff --git a/archaeological_finds/models_treatments.py b/archaeological_finds/models_treatments.py index 2bc02288b..cd52791e7 100644 --- a/archaeological_finds/models_treatments.py +++ b/archaeological_finds/models_treatments.py @@ -75,11 +75,11 @@ class Treatment(DashboardFormItem, ValueGetter, BaseHistorizedItem, ALT_NAMES = { 'label': ( pgettext_lazy("key for text search", u"label"), - 'label__icontains' + 'label__iexact' ), 'other_reference': ( pgettext_lazy("key for text search", u"other-reference"), - 'other_reference__icontains' + 'other_reference__iexact' ), 'year': ( pgettext_lazy("key for text search", u"year"), @@ -534,11 +534,11 @@ class TreatmentFile(DashboardFormItem, ClosedItem, BaseHistorizedItem, ALT_NAMES = { 'name': ( pgettext_lazy("key for text search", u"name"), - 'name__icontains' + 'name__iexact' ), 'internal_reference': ( pgettext_lazy("key for text search", u"reference"), - 'internal_reference__icontains' + 'internal_reference__iexact' ), 'year': ( pgettext_lazy("key for text search", u"year"), |