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)
- Robin
On 4/29/07, Marco Gabriel <[EMAIL PROTECTED]> wrote:
>
>
> 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_authenticated() in an easy way... any hints?
>
> Thanks.
>
> >
>
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---