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 [email protected]
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
-~----------~----~----~----~------~----~------~--~---