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 | 9417a7f43faa2a3c972b023981f72ee9da142e9e (patch) | |
| tree | d9536a4740f32e9d8068634204ca6ed418eb2b37 /archaeological_operations/forms.py | |
| parent | 1bd9e2f62a05c5c284089b4d48e886de878ee769 (diff) | |
| download | Ishtar-9417a7f43faa2a3c972b023981f72ee9da142e9e.tar.bz2 Ishtar-9417a7f43faa2a3c972b023981f72ee9da142e9e.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 | 
