summaryrefslogtreecommitdiff
path: root/archaeological_operations/forms.py
diff options
context:
space:
mode:
authorÉtienne Loks <etienne.loks@iggdrasil.net>2018-04-26 13:27:46 +0200
committerÉtienne Loks <etienne.loks@iggdrasil.net>2018-06-12 08:43:58 +0200
commit2d7c3989368998b94298eac7ce1192559d9993f3 (patch)
tree30d1c62ee5785aa534e8eedc54f2682b34fadc3e /archaeological_operations/forms.py
parentc6f7e868e9fa1eb51381c064c930b73b566ff758 (diff)
downloadIshtar-2d7c3989368998b94298eac7ce1192559d9993f3.tar.bz2
Ishtar-2d7c3989368998b94298eac7ce1192559d9993f3.zip
Operations: add ishtar images panel (refs #4076)
Diffstat (limited to 'archaeological_operations/forms.py')
-rw-r--r--archaeological_operations/forms.py12
1 files changed, 10 insertions, 2 deletions
diff --git a/archaeological_operations/forms.py b/archaeological_operations/forms.py
index 2309a4f4a..c780fdcd7 100644
--- a/archaeological_operations/forms.py
+++ b/archaeological_operations/forms.py
@@ -50,9 +50,9 @@ from ishtar_common import widgets
from ishtar_common.forms import FinalForm, FormSet, get_now, \
reverse_lazy, get_form_selection, TableSelect, get_data_from_formset, \
- ManageOldType, IshtarForm, CustomForm, FieldType
+ ManageOldType, IshtarForm, CustomForm, FieldType, FormSetWithDeleteSwitches
from ishtar_common.forms_common import TownFormSet, SourceForm, SourceSelect, \
- get_town_field, TownForm, get_image_help
+ get_town_field, TownForm, get_image_help, BaseImageForm
from archaeological_operations.utils import parse_parcels
@@ -1025,6 +1025,14 @@ class CollaboratorForm(CustomForm, IshtarForm):
self.fields['collaborator'].widget.attrs['full-width'] = True
+ImagesFormset = formset_factory(BaseImageForm, can_delete=True,
+ formset=FormSet)
+ImagesFormset.file_upload = True
+ImagesFormset.form_label = _(u"Images")
+ImagesFormset.form_admin_name = _(u"Operation - 025 - Images")
+ImagesFormset.form_slug = "operation-025-images"
+
+
class OperationFormPreventive(CustomForm, IshtarForm):
form_label = _(u"Preventive informations - excavation")
form_admin_name = _(u"Operation - 033 - Preventive - Excavation")