diff options
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 + | 
