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 | 6e443ef21bfa9eea67e7f983727c41d00405a816 (patch) | |
| tree | e81d672360a437db08de785b35d831c8b8759833 /archaeological_operations/models.py | |
| parent | 71432db3cbf135225fdb432c380db402a3eeffe7 (diff) | |
| download | Ishtar-6e443ef21bfa9eea67e7f983727c41d00405a816.tar.bz2 Ishtar-6e443ef21bfa9eea67e7f983727c41d00405a816.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"), | 
