summaryrefslogtreecommitdiff
path: root/archaeological_operations/forms.py
diff options
context:
space:
mode:
authorÉtienne Loks <etienne.loks@iggdrasil.net>2017-06-01 20:28:39 +0200
committerÉtienne Loks <etienne.loks@iggdrasil.net>2017-06-01 20:28:39 +0200
commitffa61d536ee171006cf4b485f71aa84ba9051317 (patch)
tree40c2c8f82db7598101e02c1d12a777913e25de11 /archaeological_operations/forms.py
parentd65230970c2c40fbbde74b49b38e20dabc575332 (diff)
parent9b7629324fe6bfcf912259c31176da81a015559f (diff)
downloadIshtar-ffa61d536ee171006cf4b485f71aa84ba9051317.tar.bz2
Ishtar-ffa61d536ee171006cf4b485f71aa84ba9051317.zip
Merge branch 'v0.9' into wheezy
Diffstat (limited to 'archaeological_operations/forms.py')
-rw-r--r--archaeological_operations/forms.py16
1 files changed, 12 insertions, 4 deletions
diff --git a/archaeological_operations/forms.py b/archaeological_operations/forms.py
index 86bea4ed5..8fd9233d2 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['full-width'] = True
+
+
class OperationFormPreventive(forms.Form):
form_label = _(u"Preventive informations - excavation")
cost = forms.IntegerField(label=_(u"Cost (euros)"), required=False)