diff options
| author | Étienne Loks <etienne.loks@iggdrasil.net> | 2018-07-02 19:58:25 +0200 | 
|---|---|---|
| committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2018-08-13 18:26:03 +0200 | 
| commit | 6029e4f0e58451848e2c4812d107aae190aa10c7 (patch) | |
| tree | 38143096a878386d25f9d950a8c4248a30187344 /archaeological_operations/models.py | |
| parent | 9de2c94a7a528e1ae24bc2a0a9bb9354329d0a93 (diff) | |
| download | Ishtar-6029e4f0e58451848e2c4812d107aae190aa10c7.tar.bz2 Ishtar-6029e4f0e58451848e2c4812d107aae190aa10c7.zip | |
Full text search: manage facet search (simple, hierarchic, OR) (refs #4180)
Diffstat (limited to 'archaeological_operations/models.py')
| -rw-r--r-- | archaeological_operations/models.py | 13 | 
1 files changed, 12 insertions, 1 deletions
| diff --git a/archaeological_operations/models.py b/archaeological_operations/models.py index d50c9e43c..688c12bea 100644 --- a/archaeological_operations/models.py +++ b/archaeological_operations/models.py @@ -27,7 +27,7 @@ from django.db import IntegrityError, transaction  from django.db.models import Q, Count, Sum, Max, Avg  from django.db.models.signals import post_save, m2m_changed, post_delete  from django.forms import ValidationError -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import ugettext_lazy as _, pgettext_lazy  from ishtar_common.models import BaseHistorizedItem, Dashboard, \      DashboardFormItem, Department, Document, DocumentTemplate, \ @@ -362,6 +362,17 @@ 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"), +    } +    EXTRA_REQUEST_KEYS.update(dict([(v, k) for k, v in ALT_NAMES.items()])) +      # fields definition      creation_date = models.DateField(_(u"Creation date"),                                       default=datetime.date.today) | 
