viewflow / django-material

Material Design for Django
http://viewflow.io/
BSD 3-Clause "New" or "Revised" License
2.49k stars 425 forks source link

Is there a possibility to render form in view? #441

Closed nikolaysm closed 5 years ago

nikolaysm commented 5 years ago

Now i render my form in view so:

template = Template("{% load material_form %} {% form form=form %}{% endform %}")
context = Context({"form": person_form})
rendered_form = template.render(context)
kmmbvnr commented 5 years ago

What is the scenario when it's needed?

nikolaysm commented 5 years ago

I use an ajax request to update or create an object. And then I want that Ajax Response returns a rendered form.

kmmbvnr commented 5 years ago

so to render a template is a correct solution in that case.