diff options
author | Étienne Loks <etienne.loks@iggdrasil.net> | 2017-05-17 11:15:07 +0200 |
---|---|---|
committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2017-05-17 11:15:07 +0200 |
commit | e25ebecf8304b927ad8e75aefa1e1886dab2efeb (patch) | |
tree | 09c957b3837760d776657df6f517fed7898b6c5c /archaeological_operations/forms.py | |
parent | 5960b5165179fa68cab83657cce6b936fcda1fc5 (diff) | |
download | Ishtar-e25ebecf8304b927ad8e75aefa1e1886dab2efeb.tar.bz2 Ishtar-e25ebecf8304b927ad8e75aefa1e1886dab2efeb.zip |
Operation wizard: collaborators in a specific panel (refs #3595)
Diffstat (limited to 'archaeological_operations/forms.py')
-rw-r--r-- | archaeological_operations/forms.py | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/archaeological_operations/forms.py b/archaeological_operations/forms.py index 86bea4ed5..b9e68980f 100644 --- a/archaeological_operations/forms.py +++ b/archaeological_operations/forms.py @@ -759,11 +759,9 @@ class DashboardForm(forms.Form): class OperationFormGeneral(ManageOldType, forms.Form): form_label = _(u"General") - base_models = ['collaborator'] file_upload = True associated_models = {'scientist': Person, 'in_charge': Person, - 'collaborator': Person, 'cira_rapporteur': Person, 'operator': Organization, 'operation_type': models.OperationType, @@ -819,8 +817,6 @@ class OperationFormGeneral(ManageOldType, forms.Form): limit={'person_types': [person_type_pk_lazy('sra_agent')]}, new=True), validators=[valid_id(Person)], required=False) - collaborator = widgets.Select2MultipleField( - model=Person, label=_("Collaborators"), required=False, remote=True) surface = forms.IntegerField( required=False, widget=widgets.AreaWidget, label=_(u"Total surface (m2)"), @@ -989,6 +985,18 @@ OperationFormModifGeneral.associated_models = \ OperationFormModifGeneral.associated_models['associated_file'] = File +class CollaboratorForm(forms.Form): + form_label = _(u"Collaborators") + base_models = ['collaborator'] + associated_models = {'collaborator': Person, } + collaborator = widgets.Select2MultipleField( + model=Person, label=_("Collaborators"), required=False, remote=True) + + def __init__(self, *args, **kwargs): + super(CollaboratorForm, self).__init__(*args, **kwargs) + self.fields['collaborator'].widget.attrs['style'] = 'width: 100%' + + class OperationFormPreventive(forms.Form): form_label = _(u"Preventive informations - excavation") cost = forms.IntegerField(label=_(u"Cost (euros)"), required=False) |