Re: building a menu dynamically based on user info

2007-04-29 Thread Marco Gabriel
Robin Percy schrieb: > Here's a simplified custom tag example using is_authenticated(): > > class TestTagNode(template.Node): > def render(self,context): > return "User is authenticated? %s" % > context['user'].is_authenticated() Thanks a lot, I was close, argh! :) --~--~-

Re: building a menu dynamically based on user info

2007-04-29 Thread Robin Percy
Here's a simplified custom tag example using is_authenticated(): def test_tag(parser, token): return TestTagNode() class TestTagNode(template.Node): def render(self,context): return "User is authenticated? %s" % context['user'].is_authenticated() register.tag('test_tag',test_tag

Re: building a menu dynamically based on user info

2007-04-29 Thread Marco Gabriel
Robin Percy schrieb: > It sounds like you're trying to access the user as an attribute rather > than a key in your tag renderer. Make sure you're using the syntax > context['user'] as opposed to context.user. > I tried both, but if I use context['user'] I could not find a way to apply is_authe

Re: building a menu dynamically based on user info

2007-04-29 Thread Robin Percy
It sounds like you're trying to access the user as an attribute rather than a key in your tag renderer. Make sure you're using the syntax context['user'] as opposed to context.user. - Robin On 4/29/07, Marco Gabriel <[EMAIL PROTECTED]> wrote: > > > Hi everyone, > > Scenario: I want to build a ma