summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorÉtienne Loks <etienne.loks@iggdrasil.net>2019-06-05 14:34:12 +0200
committerÉtienne Loks <etienne.loks@iggdrasil.net>2019-06-05 14:34:12 +0200
commit95739c815a9035943ca20b5ace07284d6f49e05a (patch)
treef6cfdf2c4e3630507ee3877e99f4edf8d18c2648
parent6fb7254ac5eaec71f196b3bbafdd9d216baf8d36 (diff)
downloadIshtar-95739c815a9035943ca20b5ace07284d6f49e05a.tar.bz2
Ishtar-95739c815a9035943ca20b5ace07284d6f49e05a.zip
Site search: areas criteria
-rw-r--r--archaeological_operations/forms.py2
-rw-r--r--archaeological_operations/models.py4
2 files changed, 6 insertions, 0 deletions
diff --git a/archaeological_operations/forms.py b/archaeological_operations/forms.py
index c4c61a748..26ded30fa 100644
--- a/archaeological_operations/forms.py
+++ b/archaeological_operations/forms.py
@@ -1310,6 +1310,7 @@ class SiteSelect(HistorySelect):
periods = forms.ChoiceField(label=_(u"Periods"), choices=[], required=False)
remains = forms.ChoiceField(label=_(u"Remains"), choices=[], required=False)
towns = get_town_field()
+ towns__areas = forms.ChoiceField(label=_("Areas"), choices=[])
comment = forms.CharField(label=_(u"Comment"), max_length=200,
required=False)
top_operation = forms.IntegerField(
@@ -1351,6 +1352,7 @@ class SiteSelect(HistorySelect):
TYPES = [
FieldType('periods', models.Period),
FieldType('remains', models.RemainType),
+ FieldType('towns__areas', Area),
]
def __init__(self, *args, **kwargs):
diff --git a/archaeological_operations/models.py b/archaeological_operations/models.py
index d34b2f60a..9f1e29e5e 100644
--- a/archaeological_operations/models.py
+++ b/archaeological_operations/models.py
@@ -167,6 +167,10 @@ class ArchaeologicalSite(DocumentItem, BaseHistorizedItem, QRCodeItem,
pgettext_lazy("key for text search", u"town"),
'towns__cached_label__iexact'
),
+ 'towns__areas': SearchAltName(
+ pgettext_lazy("key for text search", u"area"),
+ 'towns__areas__label__iexact'
+ ),
'comment': SearchAltName(
pgettext_lazy("key for text search", u"comment"),
'comment__iexact'