summaryrefslogtreecommitdiff
path: root/archaeological_operations/forms.py
diff options
context:
space:
mode:
authorÉtienne Loks <etienne.loks@iggdrasil.net>2018-08-08 17:15:26 +0200
committerÉtienne Loks <etienne.loks@iggdrasil.net>2018-08-13 18:26:03 +0200
commitfccd2510276e510132d121cd88e76d62b1899122 (patch)
tree7b6e4f62216cf952b98abc710bba2ebef6b93c7e /archaeological_operations/forms.py
parent15e4d32a3220f0f0f4de43f0217b893da862cc4a (diff)
downloadIshtar-fccd2510276e510132d121cd88e76d62b1899122.tar.bz2
Ishtar-fccd2510276e510132d121cd88e76d62b1899122.zip
Manage relation types in searches
Diffstat (limited to 'archaeological_operations/forms.py')
-rw-r--r--archaeological_operations/forms.py15
1 files changed, 3 insertions, 12 deletions
diff --git a/archaeological_operations/forms.py b/archaeological_operations/forms.py
index 866700871..63b350f28 100644
--- a/archaeological_operations/forms.py
+++ b/archaeological_operations/forms.py
@@ -524,9 +524,8 @@ class OperationSelect(TableSelect):
start_after = DateField(label=_(u"Started after"))
end_before = DateField(label=_(u"Ended before"))
end_after = DateField(label=_(u"Ended after"))
- relation_types = forms.MultipleChoiceField(
- label=_(u"Search within relations"), choices=[],
- widget=forms.CheckboxSelectMultiple)
+ relation_types = forms.ChoiceField(
+ label=_(u"Search within relations"), choices=[])
comment = forms.CharField(label=_(u"Comment"), max_length=500)
abstract = forms.CharField(label=_(u"Abstract (full text search)"))
scientific_documentation_comment = forms.CharField(
@@ -594,15 +593,7 @@ class OperationSelect(TableSelect):
k = 'towns__numero_insee__startswith'
self.fields[k].choices = [
('', '--')] + list(settings.ISHTAR_DPTS)
- self.fields['relation_types'].choices = models.RelationType.get_types(
- empty_first=False)
-
- def get_input_ids(self):
- ids = super(OperationSelect, self).get_input_ids()
- ids.pop(ids.index('relation_types'))
- for idx, c in enumerate(self.fields['relation_types'].choices):
- ids.append('relation_types_{}'.format(idx))
- return ids
+ self.fields['relation_types'].choices = models.RelationType.get_types()
class OperationFormSelection(IshtarForm):