From df43f19a2f61bffe4fc89baef578dd7ecb0005cc Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Sun, 15 Sep 2019 00:07:16 +0200 Subject: Add QA for orgas and operations --- archaeological_operations/forms.py | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'archaeological_operations/forms.py') 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 + -- cgit v1.2.3