diff options
| 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 | 
| commit | a35fabc84d21f03bf9525d47c2e7fcb74dd0d8ca (patch) | |
| tree | 7b6e4f62216cf952b98abc710bba2ebef6b93c7e /archaeological_operations/forms.py | |
| parent | 33e2c9896761149982d3c6157eff09b304d9b911 (diff) | |
| download | Ishtar-a35fabc84d21f03bf9525d47c2e7fcb74dd0d8ca.tar.bz2 Ishtar-a35fabc84d21f03bf9525d47c2e7fcb74dd0d8ca.zip  | |
Manage relation types in searches
Diffstat (limited to 'archaeological_operations/forms.py')
| -rw-r--r-- | archaeological_operations/forms.py | 15 | 
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):  | 
