So, Generic views are pretty cool, but what I’m interested in is something that’s a generic template.
so for example, I can give it an object and it’ll just tostring it for me.
or if I give it a list, it’ll just iterate over the objects and tostring them as a ul (or tr, or whatever else it deems necessary).
for most uses you wouldn’t need this. I just threw something together quickly for a friend (a bar stock app, if you must know), and I don’t feel like writing templates.
If there’s a django model for it, you can just stick to
django.contrib.adminordjango.contrib.databrowse. If not, then you might manage by skipping the django template altogether. example:But of course you wanted to avoid even writing that much, so instead of doing html, we can use plain text and the
pprintmodule:edit: Hmm… this seems like something a view decorator should handle: