diff options
Diffstat (limited to 'ishtar/ishtar_base/forms_context_records.py')
| -rw-r--r-- | ishtar/ishtar_base/forms_context_records.py | 29 |
1 files changed, 15 insertions, 14 deletions
diff --git a/ishtar/ishtar_base/forms_context_records.py b/ishtar/ishtar_base/forms_context_records.py index b40f5ae80..35b7b785c 100644 --- a/ishtar/ishtar_base/forms_context_records.py +++ b/ishtar/ishtar_base/forms_context_records.py @@ -34,8 +34,9 @@ from ishtar import settings import models import widgets from forms import Wizard, FinalForm, FormSet, SearchWizard, DeletionWizard, \ - formset_factory, get_now, reverse_lazy -from forms_common import get_town_field, SourceForm, SourceWizard + formset_factory, get_now, reverse_lazy, get_form_selection +from forms_common import get_town_field, SourceForm, SourceWizard, \ + SourceSelect, AuthorFormset from forms_operations import OperationFormSelection class RecordWizard(Wizard): @@ -111,11 +112,9 @@ class RecordModifWizard(RecordWizard): class RecordSelect(forms.Form): parcel__town = get_town_field() - operation__year = forms.IntegerField(label=_("Year")) - datings__period = forms.ChoiceField(label=_("Period"), - choices=models.Period.get_types()) - unit = forms.ChoiceField(label=_("Unit type"), - choices=models.Unit.get_types()) + operation__year = forms.IntegerField(label=_(u"Year")) + datings__period = forms.ChoiceField(label=_(u"Period"), choices=[]) + unit = forms.ChoiceField(label=_(u"Unit type"), choices=[]) def __init__(self, *args, **kwargs): super(RecordSelect, self).__init__(*args, **kwargs) self.fields['datings__period'].choices = \ @@ -314,12 +313,14 @@ record_source_creation_wizard = RecordSourceWizard([ url_name='record_source_creation',) class RecordSourceSelect(SourceSelect): - context_record__parcel__town = get_town_field() - context_record__operation__year = forms.IntegerField(label=_(u"Year")) - context_record__datings__period = forms.ChoiceField(label=_(u"Period"), - choices=models.Period.get_types()) - context_record__unit = forms.ChoiceField(label=_(u"Unit type"), - choices=models.Unit.get_types()) + context_record__parcel__town = get_town_field( + label=_(u"Town of the operation")) + context_record__operation__year = forms.IntegerField( + label=_(u"Year of the operation")) + context_record__datings__period = forms.ChoiceField( + label=_(u"Period of the context record"), choices=[]) + context_record__unit = forms.ChoiceField( + label=_(u"Unit type of the context record"), choices=[]) def __init__(self, *args, **kwargs): super(RecordSourceSelect, self).__init__(*args, **kwargs) @@ -333,7 +334,7 @@ class RecordSourceSelect(SourceSelect): RecordSourceFormSelection = get_form_selection( 'RecordSourceFormSelection', _(u"Documentation search"), 'pk', - models.ContextRecordSource, RecordSourceSelect, 'get-recordsource', + models.ContextRecordSource, RecordSourceSelect, 'get-contextrecordsource', _(u"You should select a document.")) record_source_modification_wizard = RecordSourceWizard([ |
