Re: custom templatetag that checks groups

2011-09-01 Thread Tom Evans
See inline: Cheers Tom On Thu, Sep 1, 2011 at 10:38 AM, Szabo, Patrick (LNG-VIE) < patrick.sz...@lexisnexis.at> wrote: > Hi, > > ** ** > > I want to create my own templatetag that returns true if a user is member > of a certain group. > > I did the following: > > ** ** > > Created

AW: custom templatetag that checks groups

2011-09-01 Thread Szabo, Patrick (LNG-VIE)
Von: django-users@googlegroups.com [mailto:django-users@googlegroups.com] Im Auftrag von Szabo, Patrick (LNG-VIE) Gesendet: Donnerstag, 01. September 2011 11:39 An: django-users@googlegroups.com Betreff: custom templatetag that checks groups Hi, I want to create my own templatetag that retur

custom templatetag that checks groups

2011-09-01 Thread Szabo, Patrick (LNG-VIE)
Hi, I want to create my own templatetag that returns true if a user is member of a certain group. I did the following: Created a package "templatetags" in my app. Wrote a module: from django import template register = template.Library() def check(user): if str(user.groups