Hi Reinout,

IMHO, Django's philosophy is that template designers are highly
skilled designers and not coders.  To make it possible for designers
to edit the templates themselves, Django requires the developer to
create a simple context dictionary for designers to understand.

In all of my projects so far I didn't have the luxury of a designer
who'se fluent in Django templates and can write them by himself, but
still, I like Django for showing a clear way for designers and coders
to work together.

Benny

On Sep 1, 11:46 pm, Reinout van Rees <rein...@vanrees.org> wrote:
> 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