summaryrefslogtreecommitdiff
path: root/archaeological_operations/models.py
diff options
context:
space:
mode:
Diffstat (limited to 'archaeological_operations/models.py')
-rw-r--r--archaeological_operations/models.py25
1 files changed, 18 insertions, 7 deletions
diff --git a/archaeological_operations/models.py b/archaeological_operations/models.py
index 688c12bea..912351f9b 100644
--- a/archaeological_operations/models.py
+++ b/archaeological_operations/models.py
@@ -364,14 +364,25 @@ class Operation(ClosedItem, BaseHistorizedItem, OwnPerms, ValueGetter,
# alternative names of fields for searches
ALT_NAMES = {
- 'periods__pk': pgettext_lazy(
- "key for text search (no accent, no spaces)", u"period"),
- 'operation_type__pk': pgettext_lazy(
- "key for text search (no accent, no spaces)", u"operation-type"),
- 'remains__pk': pgettext_lazy(
- "key for text search (no accent, no spaces)", u"remain"),
+ 'periods': (
+ pgettext_lazy(
+ "key for text search (no accent, no spaces)", u"period"),
+ 'periods__pk'
+ ),
+ 'operation_type': (
+ pgettext_lazy(
+ "key for text search (no accent, no spaces)", u"operation-type"
+ ),
+ 'operation_type__pk'
+ ),
+ 'remains': (
+ pgettext_lazy(
+ "key for text search (no accent, no spaces)", u"remain"),
+ 'remains__pk'
+ ),
}
- EXTRA_REQUEST_KEYS.update(dict([(v, k) for k, v in ALT_NAMES.items()]))
+ for v in ALT_NAMES.values():
+ EXTRA_REQUEST_KEYS[v[0]] = v[1]
# fields definition
creation_date = models.DateField(_(u"Creation date"),