Re: Template inherite and direct_to_template

2008-08-27 Thread Erik Allik
You have assumed that child templates also inherit any context that is passed to the parent templates. Unfortunately, this is not the case. This is not a limitation, but in fact makes sense -- passing the context happens when templates are rendered (in your case, in URLconf where you use di

Re: Template inherite and direct_to_template

2008-08-26 Thread Chatchai Neanudorn
Yes, it looks like *extra_context *is not* *available for rendering. Don't know how to fix, finally use templatetag to do this task. Thanks, Chachai 2008/8/27 Malcolm Tredinnick <[EMAIL PROTECTED]> > > > On Tue, 2008-08-26 at 07:10 -0700, chatchai wrote: > > Hi , > > > > It's not easy to explai

Re: Template inherite and direct_to_template

2008-08-26 Thread Malcolm Tredinnick
On Tue, 2008-08-26 at 07:10 -0700, chatchai wrote: > Hi , > > It's not easy to explain so please look at codes below, > > #url.py > base_context = { > 'books' : Book.objects.all(), > } > > urlpatterns = patterns('', > (r'^$', direct_to_template, {'extra_context': base_context, > 'templ

Re: Template inherite and direct_to_template

2008-08-26 Thread chatchai
FYI, it works if I use templatetag to get the queryset. chatchai wrote: > Hi , > > It's not easy to explain so please look at codes below, > > #url.py > base_context = { > 'books' : Book.objects.all(), > } > > urlpatterns = patterns('', > (r'^$', direct_to_template, {'extra_context': ba

Template inherite and direct_to_template

2008-08-26 Thread chatchai
Hi , It's not easy to explain so please look at codes below, #url.py base_context = { 'books' : Book.objects.all(), } urlpatterns = patterns('', (r'^$', direct_to_template, {'extra_context': base_context, 'template': 'base.html' }), (r'^books/', include('book.urls')), )