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_context_records | |
parent | fbff9e5ffda34efd195a27ddfd8f519a2dade042 (diff) | |
download | Ishtar-4dfc239a465d5130180038bc1bf7f036ba307831.tar.bz2 Ishtar-4dfc239a465d5130180038bc1bf7f036ba307831.zip |
Search: manage open search
Diffstat (limited to 'archaeological_context_records')
-rw-r--r-- | archaeological_context_records/models.py | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/archaeological_context_records/models.py b/archaeological_context_records/models.py index e3c7ff4e5..04639bb56 100644 --- a/archaeological_context_records/models.py +++ b/archaeological_context_records/models.py @@ -261,7 +261,7 @@ class ContextRecord(BulkUpdatedItem, BaseHistorizedItem, ALT_NAMES = { 'label': ( pgettext_lazy("key for text search", u"id"), - 'label' + 'label__iexact' ), 'town': ( pgettext_lazy("key for text search", u"town"), @@ -273,7 +273,7 @@ class ContextRecord(BulkUpdatedItem, BaseHistorizedItem, ), 'operation__code_patriarche': ( pgettext_lazy("key for text search", u"patriarche"), - 'operation__code_patriarche' + 'operation__code_patriarche__iexact' ), 'operation__operation_code': ( pgettext_lazy("key for text search", u"operation-code"), @@ -310,6 +310,14 @@ class ContextRecord(BulkUpdatedItem, BaseHistorizedItem, EXTRA_REQUEST_KEYS[unicode(v[0])] = v[1] deactivate() + PARENT_ONLY_SEARCH_VECTORS = ['operation', "archaeological_site"] + BASE_SEARCH_VECTORS = ["cached_label", "label", "location", "town__name", + "interpretation", "filling", "datings_comment", + "identification__label", "activity__label", + "excavation_technic__label"] + M2M_SEARCH_VECTORS = ["datings__period__label"] + history = HistoricalRecords() + # fields external_id = models.TextField(_(u"External ID"), blank=True, null=True) auto_external_id = models.BooleanField( @@ -385,13 +393,6 @@ class ContextRecord(BulkUpdatedItem, BaseHistorizedItem, blank=True) cached_label = models.TextField(_(u"Cached name"), null=True, blank=True, db_index=True) - PARENT_SEARCH_VECTORS = ['operation', "archaeological_site"] - BASE_SEARCH_VECTORS = ["cached_label", "label", "location", "town__name", - "interpretation", "filling", "datings_comment", - "identification__label", "activity__label", - "excavation_technic__label"] - M2M_SEARCH_VECTORS = ["datings__period__label"] - history = HistoricalRecords() class Meta: verbose_name = _(u"Context Record") |