diff options
author | Étienne Loks <etienne.loks@iggdrasil.net> | 2019-09-15 00:07:16 +0200 |
---|---|---|
committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2019-09-15 00:07:16 +0200 |
commit | 877ca018dea3ae180c305edc2171c5ec71af4902 (patch) | |
tree | 880eff06a16fa8537231bab8e79ca9114c68419f /archaeological_operations/forms.py | |
parent | 5c2457815a333edb98ccfb91c7bbf59db1501ccd (diff) | |
download | Ishtar-877ca018dea3ae180c305edc2171c5ec71af4902.tar.bz2 Ishtar-877ca018dea3ae180c305edc2171c5ec71af4902.zip |
Add QA for orgas and operations
Diffstat (limited to 'archaeological_operations/forms.py')
-rw-r--r-- | archaeological_operations/forms.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/archaeological_operations/forms.py b/archaeological_operations/forms.py index 3c93b945c..8ddd42708 100644 --- a/archaeological_operations/forms.py +++ b/archaeological_operations/forms.py @@ -1806,6 +1806,7 @@ class QAOperationFormMulti(QAForm): base_models = ['qa_operation_type'] associated_models = { 'qa_operation_type': models.OperationType, + 'qa_towns': Town } MULTI = True @@ -1815,8 +1816,16 @@ class QAOperationFormMulti(QAForm): qa_operation_type = forms.ChoiceField( label=_(u"Operation type"), required=False ) + qa_towns = get_town_field(required=False) TYPES = [ FieldType('qa_operation_type', models.OperationType), ] + def _get_qa_towns(self, value): + try: + value = Town.objects.get(pk=value).cached_label + except Town.DoesNotExist: + return "" + return value + |