Hi,

I've got one big what's-the-design-decision/reason question regarding django 1.3's new class based views: why does django encourage a hand-crafted context dictionary instead of "just" passing the view object along?

In zope/plone, I was used to having the view object available in the template as 'view'. The django equivalent would be to pass a context of {'view': self} to the template.

All the attributes on the view class (well, object) would be available. Django prefers the template to stay simple and stupid: what could be better than encouraging to just add extra methods to the class if you want something special? Now you have to add the method *and* pass it along in the dictionary. Double work?

Passing the view object to the template by default seems to me to be an absolute no-brainer. Class based views ought to mean you get the view object in your template, right? But Django doesn't do it. So... is there a specific reason for it?



Reinout

--
Reinout van Rees                    http://reinout.vanrees.org/
rein...@vanrees.org             http://www.nelen-schuurmans.nl/
"If you're not sure what to do, make something. -- Paul Graham"

--
You received this message because you are subscribed to the Google Groups "Django 
developers" group.
To post to this group, send email to django-developers@googlegroups.com.
To unsubscribe from this group, send email to 
django-developers+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-developers?hl=en.

Reply via email to