Django – Working with multiple forms

Use the prefix kwarg

You can declare your form as:

form = MyFormClass(prefix='some_prefix')

and then, as long as the prefix is the same, process data as:

form = MyFormClass(request.POST, prefix='some_prefix')

Django will handle the rest.

This way you can have as many forms of the same type as you want on the page

Leave a Comment