Using template inheritance via base.html, I am creating a simple
two-column site with a "content" and "sidebar" block.  The inheritance
feature works as expected. Basic html is inherited in my sidebar from
base.html and can be written over in the sidebar block if so desired.

However, I'm perplexed about how to inherit an object into my sidebar block.

Normally, when I call a view, I can retrieve an object and pass it to
the html page via the dictionary in render_to_response. But in my site
I need that same object in the sidebar of every rendering of the
website.

It seems I'm violating the DRY principle if I retrieve that object and
put it into the dictionary of every render_to_response statement in
every view.  Isn't there a way to inherit the objects as well for
every view?

How do I make the values of an object appear in my sidebar (in other
words in every view)?

Thanks.
--
-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@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.


Reply via email to