diff options
Diffstat (limited to 'archaeological_operations/forms.py')
| -rw-r--r-- | archaeological_operations/forms.py | 18 | 
1 files changed, 15 insertions, 3 deletions
| diff --git a/archaeological_operations/forms.py b/archaeological_operations/forms.py index 2754f2d1a..1a9fffa6e 100644 --- a/archaeological_operations/forms.py +++ b/archaeological_operations/forms.py @@ -195,11 +195,16 @@ class OperationSelect(TableSelect):      towns = get_town_field()      operation_type = forms.ChoiceField(label=_(u"Operation type"),                                         choices=[]) -    in_charge = forms.IntegerField( +    scientist = forms.IntegerField(          widget=widgets.JQueryAutoComplete(reverse_lazy('autocomplete-person',            args=["_".join(           [unicode(PersonType.objects.get(txt_idx='head_scientist').pk),            unicode(PersonType.objects.get(txt_idx='sra_agent').pk)])]), +        associated_model=Person), label=_(u"Scientist in charge")) +    in_charge = forms.IntegerField( +        widget=widgets.JQueryAutoComplete(reverse_lazy('autocomplete-person', +          args=["_".join( +         [unicode(PersonType.objects.get(txt_idx='sra_agent').pk)])]),          associated_model=Person), label=_(u"In charge"))      remains = forms.ChoiceField(label=_(u"Remains"), choices=[])      periods = forms.ChoiceField(label=_(u"Periods"), choices=[]) @@ -273,19 +278,26 @@ class OperationCodeInput(forms.TextInput):  class OperationFormGeneral(forms.Form):      form_label = _(u"General")      base_model = 'archaeological_site' -    associated_models = {'in_charge':Person, +    associated_models = {'scientist':Person, +                         'in_charge':Person,                           'associated_file':File,                           'operation_type':models.OperationType,                           'archaeological_site':models.ArchaeologicalSite}      currents = {'associated_file':File}      pk = forms.IntegerField(required=False, widget=forms.HiddenInput) -    in_charge = forms.IntegerField(label=_("Person in charge of the operation"), +    scientist = forms.IntegerField(label=_("Head scientist"),          widget=widgets.JQueryAutoComplete(reverse_lazy('autocomplete-person',            args=["_".join(           [unicode(PersonType.objects.get(txt_idx='head_scientist').pk),            unicode(PersonType.objects.get(txt_idx='sra_agent').pk)])]),          associated_model=Person, new=True),          validators=[valid_id(Person)], required=False) +    in_charge = forms.IntegerField(label=_("In charge"), +        widget=widgets.JQueryAutoComplete(reverse_lazy('autocomplete-person', +          args=["_".join( +         [unicode(PersonType.objects.get(txt_idx='sra_agent').pk)])]), +        associated_model=Person, new=True), +        validators=[valid_id(Person)], required=False)      associated_file = forms.IntegerField(label=_(u"Archaelogical file"),           widget=widgets.JQueryAutoComplete(reverse_lazy('autocomplete-file'),                                             associated_model=File), | 
