On Aug 26, 4:14 pm, gentlestone <tibor.b...@hotmail.com> wrote: > I'm looking for a support for viewing models in templates. > > Forms is a nice support but it is made for editing objects, not for > viewing objects. I found some attemps on the internet, like using > forms with ReadOnlyWidgets, but I thing it is not the way. > > Forms are great, because a template-designer can use the general > as_table() and don't have to know too much about the model. And also > the dependency between the model and templates are isolated via Forms. > And also it is good when a template-designer can iterate through form > fields or directly use fileds like form.theField attribute. > > Unfortunately there is no such support for viewing model instances in > templates. Yes of course, there is a possibility use the "dot" like > instance.theAttribute in the template, but this means strong template > dependency on models and also the template designer can't use _meta > informations like verbose names and so. Yes, I can make for my models > some methods like constructTemplateDictionaryForXyView, feed the > dictionary with model attributes and models opts, but what I am > looking for are support classes like Form and ModelForm for > constructing dictionares for HTML rendering from models metamodels. > > I am ready to write such support for myself, but it is a long task and > propably i am thinking in wrong way, because nobody has written it yet.
You might want to look at django.contrib.databrowse - it sounds like it does what you want. See: http://docs.djangoproject.com/en/dev/ref/contrib/databrowse/ -- DR. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~----------~----~----~----~------~----~------~--~---