Quick-render an object in generic CBV

5 views
Skip to first unread message

Ankush Thakur

unread,
Jun 9, 2016, 5:33:43 PM6/9/16
to django...@googlegroups.com
I'm exploring generic class-based views these days, and was wondering about something. When I use DetailView, the object gets passed to the template, where I have to print all of the properties one by one in the desired HTML element.

I was wondering if it's possible to quick-render an object the way we do with model forms? I mean, is there some way I can say something like 'object.as_table()'? I thought of using FormView as a substitute for this, but that requires data to be present in POST, and forcibly populating POST seems like a bad idea.

Any thoughts?

Regards,
Ankush Thakur
Reply all
Reply to author
Forward
0 new messages