diff options
| author | Étienne Loks <etienne.loks@iggdrasil.net> | 2018-07-04 17:50:10 +0200 | 
|---|---|---|
| committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2018-08-13 18:26:03 +0200 | 
| commit | f642961947a1a4fb79e49ff764d93b3f0ab474db (patch) | |
| tree | 79b25c8593b8bdec8c938e12da00b1da9f57bba4 /archaeological_operations/models.py | |
| parent | aac03c20b75d0d12b63d532766b55714866d103e (diff) | |
| download | Ishtar-f642961947a1a4fb79e49ff764d93b3f0ab474db.tar.bz2 Ishtar-f642961947a1a4fb79e49ff764d93b3f0ab474db.zip | |
Criteria search: manage boolean search (refs #4180)
Diffstat (limited to 'archaeological_operations/models.py')
| -rw-r--r-- | archaeological_operations/models.py | 64 | 
1 files changed, 31 insertions, 33 deletions
| diff --git a/archaeological_operations/models.py b/archaeological_operations/models.py index b929677b8..1c3bbde99 100644 --- a/archaeological_operations/models.py +++ b/archaeological_operations/models.py @@ -37,7 +37,7 @@ from ishtar_common.models import BaseHistorizedItem, Dashboard, \      post_delete_record_relation, post_save_cache, RelationItem, \      ShortMenuItem, SourceType, Town, ValueGetter  from ishtar_common.utils import cached_label_changed, \ -    force_cached_label_changed, mode +    force_cached_label_changed, mode, TXT_SEARCH_COMMENT  class RemainType(GeneralType): @@ -357,51 +357,50 @@ class Operation(ClosedItem, BaseHistorizedItem, OwnPerms, ValueGetter,      # alternative names of fields for searches      ALT_NAMES = { -        '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"type" -            ), -            'operation_type__pk' -        ), -        'remains': ( -            pgettext_lazy( -                "key for text search (no accent, no spaces)", u"remain"), -            'remains__pk' -        ),          'year': ( -            pgettext_lazy( -                "key for text search (no accent, no spaces)", u"year"), +            pgettext_lazy(TXT_SEARCH_COMMENT, u"year"),              'year'          ),          'operation_code': ( -            pgettext_lazy( -                "key for text search (no accent, no spaces)", u"operation-code" -            ), +            pgettext_lazy(TXT_SEARCH_COMMENT, u"operation-code"),              'operation_code'          ),          'code_patriarche': ( -            pgettext_lazy( -                "key for text search (no accent, no spaces)", u"patriarche" -            ), +            pgettext_lazy(TXT_SEARCH_COMMENT, u"patriarche"),              'code_patriarche'          ),          'towns': ( -            pgettext_lazy( -                "key for text search (no accent, no spaces)", u"town" -            ), +            pgettext_lazy(TXT_SEARCH_COMMENT, u"town"),              'towns__cached_label__iexact'          ),          'towns__numero_insee__startswith': ( -            pgettext_lazy( -                "key for text search (no accent, no spaces)", u"department" -            ), +            pgettext_lazy(TXT_SEARCH_COMMENT, u"department"),              'towns__numero_insee__startswith' -        ) +        ), +        'common_name': ( +            pgettext_lazy(TXT_SEARCH_COMMENT, u"name"), +            'common_name' +        ), +        'address': ( +            pgettext_lazy(TXT_SEARCH_COMMENT, u"address"), +            'address' +        ), +        'operation_type': ( +            pgettext_lazy(TXT_SEARCH_COMMENT, u"type"), +            'operation_type__pk' +        ), +        'end_date': ( +            pgettext_lazy(TXT_SEARCH_COMMENT, u"is-open"), +            'end_date__isnull' +        ), +        'periods': ( +            pgettext_lazy(TXT_SEARCH_COMMENT, u"period"), +            'periods__pk' +        ), +        'remains': ( +            pgettext_lazy(TXT_SEARCH_COMMENT, u"remain"), +            'remains__pk' +        ),      }      for v in ALT_NAMES.values():          EXTRA_REQUEST_KEYS[v[0]] = v[1] @@ -586,7 +585,6 @@ class Operation(ClosedItem, BaseHistorizedItem, OwnPerms, ValueGetter,                  return k          return u"" -      @property      def short_class_name(self):          return _(u"OPE") | 
