diff options
author | Étienne Loks <etienne.loks@peacefrogs.net> | 2014-02-20 13:09:03 +0100 |
---|---|---|
committer | Étienne Loks <etienne.loks@peacefrogs.net> | 2014-02-20 13:09:03 +0100 |
commit | c7a866fa44e6d46662337a9d7834a099f6e3cc22 (patch) | |
tree | 6ee2b89fc33d08825d3b3d347a916086df5722aa /archaeological_operations/forms.py | |
parent | 9f3ff1e55ac1ae4055093c8571d1e7ef49684fdd (diff) | |
download | Ishtar-c7a866fa44e6d46662337a9d7834a099f6e3cc22.tar.bz2 Ishtar-c7a866fa44e6d46662337a9d7834a099f6e3cc22.zip |
Operations: in_charge -> scientist - new field in_charge (refs #1600)
* model update
* forms update
* templates update
* search update
* operation owned update
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), |