On Fri, Sep 2, 2011 at 3:00 PM, Greg Donald <gdon...@gmail.com> wrote:
> On Thu, Sep 1, 2011 at 3:46 PM, Reinout van Rees <rein...@vanrees.org> wrote:
>> why does django encourage a hand-crafted
>> context dictionary instead of "just" passing the view object along?
>
> I think it's the worst part of using Django.  Having to manage a
> context dictionary in every view is weak.

To the best of my knowledge, the only reason the view isn't included
in the template context is because over more than two years of design
discussion, I don't think the idea of including the view in the
context was ever proposed.

It seems like a reasonable idea to me, though, and it should be
possible to accommodate in a backwards compatible fashion. The trivial
fix would be to add a 'view' variable to the default context. It might
also be possible to replace the default get_context_data
implementation with something that reflects the attributes of the view
object  itself -- however, this will obviously require a bit more
design work to make sure there aren't any backwards incompatible
implications.

Patches welcome ;-)

Yours,
Russ Magee %-)

-- 
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