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 | 31873237b90c588f49f403721a382df59719ca1b (patch) | |
tree | 38143096a878386d25f9d950a8c4248a30187344 /archaeological_operations/models.py | |
parent | 8533647dd9c2eb008ccfca14813e055e1f5708ef (diff) | |
download | Ishtar-31873237b90c588f49f403721a382df59719ca1b.tar.bz2 Ishtar-31873237b90c588f49f403721a382df59719ca1b.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) |