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 | df43f19a2f61bffe4fc89baef578dd7ecb0005cc (patch) | |
tree | 880eff06a16fa8537231bab8e79ca9114c68419f /archaeological_operations | |
parent | f87aa359f5c0dcf7372dca67690fc1baf1178b86 (diff) | |
download | Ishtar-df43f19a2f61bffe4fc89baef578dd7ecb0005cc.tar.bz2 Ishtar-df43f19a2f61bffe4fc89baef578dd7ecb0005cc.zip |
Add QA for orgas and operations
Diffstat (limited to 'archaeological_operations')
-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 + |