Friday, February 4, 2011

Re: Custom/Inclusion Tags

On 4 fév, 16:19, J J <dja...@dangeometer.com> wrote:
> I have a inclusion tag that needs to access a named param in the url.  From
> what I understand inclusion tags can only get information from
> RequestContext.
>
> I seem to have solved my problem by putting the value into RequestContext
> from the view that calls the page /main/site/01/2011.

If you enable the "request" context processor in your settings AND use
a ContextRequest in your views, you can access the request (and from
there the GET params) from the context, so you don't need to manage
this at the view level.

http://docs.djangoproject.com/en/1.2/ref/templates/api/#django-core-context-processors-request

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