3👍
✅
You could probably do something like this:
<form action="." method="post" enctype="multipart/form-data">
{{ImageForm.image}} <br />
{{AlbumForm.notes}} <br />
{{AlbumForm.display}} <br />
...
<input type="submit" value="Save" />
</form>
This will return both form1 and form2 objects in your request.POST object.
views.py:
...
return render_to_response('art/create.html',
{'ImageForm': form1, 'AlbumForm': form2},
context_instance = RequestContext(request)
)
Or you could do this:
...
return render_to_response('art/create.html',
locals(),
context_instance = RequestContext(request)
)
Although, the second one will add all variables your function uses so you should make sure that if you use it that your function won’t be using any builtin names. Usually uncommon, but you should just make sure.
EDIT: Added a submit button to make it clear you only need one. Also added the view’s response.
Source:stackexchange.com