summaryrefslogtreecommitdiff
path: root/archaeological_context_records/models.py
diff options
context:
space:
mode:
Diffstat (limited to 'archaeological_context_records/models.py')
-rw-r--r--archaeological_context_records/models.py19
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")