diff options
author | Étienne Loks <etienne.loks@iggdrasil.net> | 2016-01-27 19:24:00 +0100 |
---|---|---|
committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2016-01-27 19:24:00 +0100 |
commit | 29fe73d51ae8e50caffe5bb6e0cf2ba939d9a70d (patch) | |
tree | 8bf97c52e86a824093db25131ea12243e96ecd3b /archaeological_operations/forms.py | |
parent | 995fa47d8cb0a9e2922cde89b7eaaf61968fe343 (diff) | |
download | Ishtar-29fe73d51ae8e50caffe5bb6e0cf2ba939d9a70d.tar.bz2 Ishtar-29fe73d51ae8e50caffe5bb6e0cf2ba939d9a70d.zip |
Manage relation types in searches - relation type search for operations
Diffstat (limited to 'archaeological_operations/forms.py')
-rw-r--r-- | archaeological_operations/forms.py | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/archaeological_operations/forms.py b/archaeological_operations/forms.py index ec66a2a7a..294e3163c 100644 --- a/archaeological_operations/forms.py +++ b/archaeological_operations/forms.py @@ -1,6 +1,6 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- -# Copyright (C) 2010-2015 Étienne Loks <etienne.loks_AT_peacefrogsDOTnet> +# Copyright (C) 2010-2016 Étienne Loks <etienne.loks_AT_peacefrogsDOTnet> # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as @@ -464,6 +464,9 @@ class OperationSelect(TableSelect): report_processing = forms.ChoiceField(label=_(u"Report processing"), choices=[]) virtual_operation = forms.NullBooleanField(label=_(u"Virtual operation")) + relation_types = forms.MultipleChoiceField( + label=_(u"Search within relations"), choices=[], + widget=forms.CheckboxSelectMultiple) def __init__(self, *args, **kwargs): super(OperationSelect, self).__init__(*args, **kwargs) @@ -481,12 +484,17 @@ class OperationSelect(TableSelect): self.fields['periods'].help_text = models.Period.get_help() self.fields['record_quality'].choices = \ [('', '--')] + list(models.QUALITY) + 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('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 |