diff options
Diffstat (limited to 'archaeological_operations/forms.py')
| -rw-r--r-- | archaeological_operations/forms.py | 7 | 
1 files changed, 4 insertions, 3 deletions
diff --git a/archaeological_operations/forms.py b/archaeological_operations/forms.py index 00b99ea2b..ce87685a2 100644 --- a/archaeological_operations/forms.py +++ b/archaeological_operations/forms.py @@ -620,6 +620,7 @@ class OperationSelect(TableSelect):  class OperationFormSelection(IshtarForm): +    SEARCH = True      form_label = _(u"Operation search")      associated_models = {'pk': models.Operation}      currents = {'pk': models.Operation} @@ -782,12 +783,12 @@ class OperationFormGeneral(CustomForm, ManageOldType):                                            max_length=500,                                            widget=OAWidget,                                            required=False) +    operation_type = forms.ChoiceField(label=_(u"Operation type"), +                                       choices=[])      common_name = forms.CharField(label=_(u"Generic name"), required=False,                                    max_length=500, widget=forms.Textarea)      address = forms.CharField(label=_(u"Address / Locality"), required=False,                                max_length=500, widget=forms.Textarea) -    operation_type = forms.ChoiceField(label=_(u"Operation type"), -                                       choices=[])      year = forms.IntegerField(label=_(u"Year"),                                initial=lambda: datetime.datetime.now().year,                                validators=[validators.MinValueValidator(1000), @@ -921,7 +922,7 @@ class OperationFormGeneral(CustomForm, ManageOldType):              fields = OrderedDict()              ope_code = self.fields.pop('operation_code')              for key, value in self.fields.items(): -                if key == 'year': +                if key == 'old_code':                      fields['operation_code'] = ope_code                  fields[key] = value              self.fields = fields  | 
