diff options
author | Étienne Loks <etienne.loks@iggdrasil.net> | 2018-07-03 18:26:38 +0200 |
---|---|---|
committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2018-08-13 18:26:03 +0200 |
commit | 81c1f3449d055ed43e760fb93028ca4b6e009749 (patch) | |
tree | e81d672360a437db08de785b35d831c8b8759833 /archaeological_operations/models.py | |
parent | 048e157bf9d288b6500191fdbba8ea6fa49a62c9 (diff) | |
download | Ishtar-81c1f3449d055ed43e760fb93028ca4b6e009749.tar.bz2 Ishtar-81c1f3449d055ed43e760fb93028ca4b6e009749.zip |
Change criteria search UI to put criteria in the search text (refs #4180)
Diffstat (limited to 'archaeological_operations/models.py')
-rw-r--r-- | archaeological_operations/models.py | 25 |
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"), |