summaryrefslogtreecommitdiff
path: root/archaeological_operations
diff options
context:
space:
mode:
authorÉtienne Loks <etienne.loks@iggdrasil.net>2018-08-14 18:03:53 +0200
committerÉtienne Loks <etienne.loks@iggdrasil.net>2018-08-14 18:03:53 +0200
commitfcc39721a61985c14b45b365ff513d8a5ecf510e (patch)
treed3a52fda81355786a629b3e38de512e20043c066 /archaeological_operations
parentd50d5077f9bf5eb6733de1a4a29d3ef1089cdd96 (diff)
downloadIshtar-fcc39721a61985c14b45b365ff513d8a5ecf510e.tar.bz2
Ishtar-fcc39721a61985c14b45b365ff513d8a5ecf510e.zip
Treatment searches
Diffstat (limited to 'archaeological_operations')
-rw-r--r--archaeological_operations/forms.py6
-rw-r--r--archaeological_operations/models.py40
2 files changed, 43 insertions, 3 deletions
diff --git a/archaeological_operations/forms.py b/archaeological_operations/forms.py
index d57a890eb..cfb62d6ec 100644
--- a/archaeological_operations/forms.py
+++ b/archaeological_operations/forms.py
@@ -471,7 +471,7 @@ RecordRelationsFormSet.form_admin_name = _(u"Operation - 080 - Relations")
RecordRelationsFormSet.form_slug = "operation-080-relations"
-class OperationSelect(TableSelect): # OK
+class OperationSelect(TableSelect):
_model = models.Operation
search_vector = forms.CharField(
@@ -1230,7 +1230,7 @@ class OperationDeletionForm(FinalForm):
#########
-class SiteSelect(TableSelect): # OK
+class SiteSelect(TableSelect):
_model = models.ArchaeologicalSite
search_vector = forms.CharField(
@@ -1376,7 +1376,7 @@ class SiteUnderwaterForm(ManageOldType):
################################################
-class AdministrativeActOpeSelect(TableSelect): # OK
+class AdministrativeActOpeSelect(TableSelect):
_model = models.AdministrativeAct
search_vector = forms.CharField(
diff --git a/archaeological_operations/models.py b/archaeological_operations/models.py
index 082bbd2fe..34a3d2a01 100644
--- a/archaeological_operations/models.py
+++ b/archaeological_operations/models.py
@@ -1472,6 +1472,46 @@ class AdministrativeAct(BaseHistorizedItem, OwnPerms, ValueGetter):
pgettext_lazy(TXT_SEARCH_COMMENT, u"file-permit-reference"),
'associated_file__permit_reference__iexact'
),
+ 'treatment__name': (
+ pgettext_lazy(TXT_SEARCH_COMMENT, u"treatment-name"),
+ 'treatment__label__icontains'
+ ),
+ 'treatment__other_reference': (
+ pgettext_lazy(TXT_SEARCH_COMMENT, u"treatment-reference"),
+ 'treatment__other_reference__icontains'
+ ),
+ 'treatment__year': (
+ pgettext_lazy(TXT_SEARCH_COMMENT, u"treatment-year"),
+ 'treatment__year'
+ ),
+ 'treatment__index': (
+ pgettext_lazy(TXT_SEARCH_COMMENT, u"treatment-index"),
+ 'treatment__index'
+ ),
+ 'treatment__treatment_types': (
+ pgettext_lazy(TXT_SEARCH_COMMENT, u"treatment-type"),
+ 'treatment__treatment_types__label__iexact'
+ ),
+ 'treatment_file__name': (
+ pgettext_lazy(TXT_SEARCH_COMMENT, u"treatment-file-name"),
+ 'treatment_file__name__icontains'
+ ),
+ 'treatment_file__internal_reference': (
+ pgettext_lazy(TXT_SEARCH_COMMENT, u"treatment-file-reference"),
+ 'treatment_file__internal_reference__icontains'
+ ),
+ 'treatment_file__year': (
+ pgettext_lazy(TXT_SEARCH_COMMENT, u"treatment-file-year"),
+ 'treatment_file__year'
+ ),
+ 'treatment_file__index': (
+ pgettext_lazy(TXT_SEARCH_COMMENT, u"treatment-file-index"),
+ 'treatment_file__index'
+ ),
+ 'treatment_file__type': (
+ pgettext_lazy(TXT_SEARCH_COMMENT, u"treatment-file-type"),
+ 'treatment_file__type__label__iexact'
+ ),
}
for v in ALT_NAMES.values():
EXTRA_REQUEST_KEYS[v[0]] = v[1]