Description
Why do we need this improvement?
In most of my Django projects, I render my form from the view, and I believe most of the Django developers out there use it to make life easier. here is the case: I have customised all my Django form controls(inputs, select, textarea, etc.) using tailwind, and I wanted to use it in a unicorn template, but then I got an error that says the form is not JSON serialisable. this is a form I am using on other parts of the site, so I do the same. I can't just type out the whole thing again.
How will this change help?
if there is a way to not serialise the form so that it goes straight to the template as a Django form and not JSON data, that would help. then, in the unicorn view, we can do the validation and submission, etc.
Please add screenshots if applicable
How could it be implemented/designed?
I'm not sure if this would work, but sending two forms of data to the template makes sense. serialized data, and python data.
another option is to add a method that will create a dictionary from the form_class attribute, containing all the essential data needed to render the form.
Will this be a breaking change?
- Yes
- No