On Sat, 14 Jan 2006 16:12:50 -0000 Alice wrote:
> I just finished writing the tag and realized that it won't work unless
> I can access the data passed to the template. Any help in getting
> around this (probably simple) problem would be welcome.
The 'render' method of custom tag gets passed the 'context' of the
template:
class YouCustomTagNode:
def render(self, context):
...
That context is the same one passed into the template for rendering. If
the custom tag always uses the same data from the context, this is the
way to go, and is very easy.
Luke
--
"He knows the way I take: when he has tried me, I shall come forth as
gold" (Job 23:10).
Luke Plant || L.Plant.98 (at) cantab.net || http://lukeplant.me.uk/