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
commit79810a785ecd31185629750b4f272c30698aa2dd (patch)
tree30d1c62ee5785aa534e8eedc54f2682b34fadc3e /archaeological_operations/forms.py
parent7f6bff8f281a31949c6f1dc185c8c7fc169b74d2 (diff)
downloadIshtar-79810a785ecd31185629750b4f272c30698aa2dd.tar.bz2
Ishtar-79810a785ecd31185629750b4f272c30698aa2dd.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")