I have this form that includes around 25 inputs on the same. It includes a main image input and the rest are some text inputs or drop down menus.
我有这个表格包含了大约25个相同的输入。它包括一个主图像输入,其余是一些文本输入或下拉菜单。
The problem is that I also need the user to upload multiple images. I was thinking of doing it on the next page itself.
问题是我还需要用户上传多张图片。我想在下一页上做这个。
I have 2 questions:
我有两个问题:
1
With formsets you allow the user to create several images at once. To create a formset out of an ImageForm you would do:
使用formset,您允许用户同时创建多个图像。要从ImageForm中创建一个窗体,您需要:
>>> from django.forms.formsets import formset_factory
>>> ImageFormSet = formset_factory(ImageForm)
https://docs.djangoproject.com/en/1.5/topics/forms/formsets/
https://docs.djangoproject.com/en/1.5/topics/forms/formsets/
And Django comes with an optional “form wizard” application that splits forms across multiple Web pages. It maintains state in one of the backends so that the full server-side processing can be delayed until the submission of the final form.
Django提供了一个可选的“表单向导”应用程序,可以在多个Web页面上分割表单。它在一个后端中维护状态,以便可以将完整的服务器端处理延迟到提交最终表单。
https://docs.djangoproject.com/en/1.5/ref/contrib/formtools/form-wizard/
https://docs.djangoproject.com/en/1.5/ref/contrib/formtools/form-wizard/
本站翻译的文章,版权归属于本站,未经许可禁止转摘,转摘请注明本文地址:http://www.itdaan.com/blog/2013/09/17/f0ffa616caa9aa89f90c9daa600d9233.html。