Malcom thanks for the help. I didn't post any more code, 'cause the
inclusion tag is merely a two liner! I try to make my posts short,
trying to make it easier for others to reply. I guess sometimes it
makes things look obscure/out of context :)

Daniel, thanks, that was what I was looking for. I thought that just
by declaring context in the def, the template itself got access to all
the context variables.

On Apr 2, 11:03 am, Daniel Roseman <[EMAIL PROTECTED]>
wrote:
> On Apr 1, 3:40 pm, Panos Laganakos <[EMAIL PROTECTED]> wrote:
>
>
>
> > I changed the definition of the inclusion tag to accept a second
> > parameter in the form of:
>
> > def my_function(context, myparam):
> >     ...
>
> > but I didn't get access to the variables  in the context, I had to:
>
> > return {
> >     'myparam': myparam,
> >     'acontextvar': context['acontextvar']
>
> > }
>
> > Is this normal, or am I supposed to get access to all of them once I
> > include context as my first param?
>
> Yes. takes_context makes the context available to your template tag
> function. If you want your tag's template in turn to have access to
> one of those variables, you'll need to pass it in the return
> statement.
> --
> DR.
--~--~---------~--~----~------------~-------~--~----~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to