diff options
author | Étienne Loks <etienne.loks@iggdrasil.net> | 2018-01-16 12:43:47 +0100 |
---|---|---|
committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2018-01-16 12:43:47 +0100 |
commit | 8ef32e342ced4f40bbd967b1debe540c42066f35 (patch) | |
tree | d9536a4740f32e9d8068634204ca6ed418eb2b37 /archaeological_operations/forms.py | |
parent | d907c65320350b6bf39275edd05d823873437c41 (diff) | |
download | Ishtar-8ef32e342ced4f40bbd967b1debe540c42066f35.tar.bz2 Ishtar-8ef32e342ced4f40bbd967b1debe540c42066f35.zip |
UI: more explicit layout for search
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 |