summaryrefslogtreecommitdiff
path: root/archaeological_context_records/forms.py
diff options
context:
space:
mode:
authorÉtienne Loks <etienne.loks@iggdrasil.net>2016-04-19 18:33:16 +0200
committerÉtienne Loks <etienne.loks@iggdrasil.net>2016-04-19 18:33:16 +0200
commiteb471a13710be88ca249f30a68bd056aa8c5a292 (patch)
treef2596427b81ad0df9e3a0b1b97201372b9fcc9cc /archaeological_context_records/forms.py
parent983662e505adca020492e0672968a19c0abb6ec2 (diff)
parentfc1c422e6c5e0c57ddb6209b609b2335f9cb4dde (diff)
downloadIshtar-eb471a13710be88ca249f30a68bd056aa8c5a292.tar.bz2
Ishtar-eb471a13710be88ca249f30a68bd056aa8c5a292.zip
Merge branch 'master' into v0.9
Diffstat (limited to 'archaeological_context_records/forms.py')
-rw-r--r--archaeological_context_records/forms.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/archaeological_context_records/forms.py b/archaeological_context_records/forms.py
index e9b5994eb..5160c1c51 100644
--- a/archaeological_context_records/forms.py
+++ b/archaeological_context_records/forms.py
@@ -59,6 +59,9 @@ class RecordSelect(TableSelect):
datings__period = forms.ChoiceField(label=_(u"Period"), choices=[])
unit = forms.ChoiceField(label=_(u"Unit type"), choices=[])
parcel = ParcelField(label=_(u"Parcel (section/number)"))
+ relation_types = forms.MultipleChoiceField(
+ label=_(u"Search within relations"), choices=[],
+ widget=forms.CheckboxSelectMultiple)
def __init__(self, *args, **kwargs):
super(RecordSelect, self).__init__(*args, **kwargs)
@@ -66,12 +69,17 @@ class RecordSelect(TableSelect):
self.fields['datings__period'].help_text = Period.get_help()
self.fields['unit'].choices = models.Unit.get_types()
self.fields['unit'].help_text = models.Unit.get_help()
+ self.fields['relation_types'].choices = models.RelationType.get_types(
+ empty_first=False)
def get_input_ids(self):
ids = super(RecordSelect, self).get_input_ids()
ids.pop(ids.index('parcel'))
ids.append('parcel_0')
ids.append('parcel_1')
+ ids.pop(ids.index('relation_types'))
+ for idx, c in enumerate(self.fields['relation_types'].choices):
+ ids.append('relation_types_{}'.format(idx))
return ids