diff options
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)  | 
