Home:ALL Converter>Django Multiple Forms Handling

Django Multiple Forms Handling

Ask Time:2017-08-01T02:29:49         Author:ofekzi

Json Formatter

I am new to Django and tried making a view that holds a list of forms and handles them. I am familiar with the FormView provided by django's generic views however it only holds one form in it. The idea is that the main form I have is split into a few forms, and then the "mini-forms" are held in a list ("forms"). Since I'm splitting the form into parts and saving a list of forms (for reasons like re-usability and such), the template looks something like this (which does the trick):

...
<form ...>
  {% for form in forms %}
   {{ form.as_p }}
  {% endfor %}
  <input type="submit"...>
</form>
...

I have been messing around with the view that should handle the forms, validate them and will get the data from them. Since I feel like Im making it more complicated than it should really be, I'd like to ask you to give an example of a simple view for that, that Ill develop further (get

Author:ofekzi,eproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/45422899/django-multiple-forms-handling
yy