summaryrefslogtreecommitdiff
path: root/archaeological_operations/forms.py
diff options
context:
space:
mode:
Diffstat (limited to 'archaeological_operations/forms.py')
-rw-r--r--archaeological_operations/forms.py10
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