From cb2bdf1cf1ee85ddf68e93c29611024571961c5d Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Fri, 11 May 2018 17:33:47 +0200 Subject: Adapt forms and wizards to manage M2M images (refs #4076) --- archaeological_warehouse/forms.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'archaeological_warehouse/forms.py') diff --git a/archaeological_warehouse/forms.py b/archaeological_warehouse/forms.py index e13255efc..27f03e752 100644 --- a/archaeological_warehouse/forms.py +++ b/archaeological_warehouse/forms.py @@ -33,7 +33,8 @@ from bootstrap_datepicker.widgets import DatePicker from ishtar_common.forms import name_validator, reverse_lazy, \ get_form_selection, TableSelect, ManageOldType, FinalForm, FormSet, \ CustomForm, FieldType -from ishtar_common.forms_common import get_image_help +from ishtar_common.forms_common import get_image_help, BaseImageFormset, \ + BaseImageForm from archaeological_finds.forms import FindMultipleFormSelection, \ SelectFindBasketForm @@ -160,6 +161,14 @@ class WarehouseForm(CustomForm, ManageOldType, forms.Form): return new_item +ImagesFormset = formset_factory(BaseImageForm, can_delete=True, + formset=BaseImageFormset) +ImagesFormset.file_upload = True +ImagesFormset.form_label = _(u"Images") +ImagesFormset.form_admin_name = _(u"Warehouse - 025 - Images") +ImagesFormset.form_slug = "warehouse-020-images" + + class WarehouseDeletionForm(FinalForm): confirm_msg = _(u"Would you like to delete this warehouse?") confirm_end_msg = _(u"Would you like to delete this warehouse?") -- cgit v1.2.3