Wednesday, December 29, 2010

Re: merge 2 views?

Look into context processors, that sounds like what you need.

http://docs.djangoproject.com/en/dev/ref/templates/api/#subclassing-context-requestcontext
--
Michael <mhall119@gmail.com>

On Wed, 2010-12-29 at 08:51 -0800, Thom van Ledden wrote:
> Hi django developers,
>
> Ive got a seperate navigation.html file which need to be rendered on
> each page, but the page need some vars for that. how can i get those
> vars to be defined just only once?
>
> my idea: the main_page should add the vars for the navigation, and the
> views of the content pages will have their own vars, and those need to
> be merged some how
> some files i uploaded: http://thomvl.pastebin.com/gGjGj4NP
> http://thomvl.pastebin.com/uYUp5iCj http://thomvl.pastebin.com/Yv6fPTP7
>
> could anyone point me where i go wrong? (the main_page 's vars are the
> ones i need, aside of title ofcourse)
>
> Thanks in advance
>

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

No comments:

Post a Comment