Re: is_member_of method for user objects

2006-02-11 Thread Max Battcher
Roberto Aguilar wrote: In my situation, what I wanted to do was limit the display of a bunch of menu items depending on the group of the user. I accomplished this with a for loop and a test for a group: {% for group in user.get_list %} {% ifequal group 'desired_group' %} [...] It's a two-step

Re: is_member_of method for user objects

2006-02-11 Thread Roberto Aguilar
In my situation, what I wanted to do was limit the display of a bunch of menu items depending on the group of the user. I accomplished this with a for loop and a test for a group: {% for group in user.get_list %} {% ifequal group 'desired_group' %} [...] It's a two-step process rather than one,

Re: is_member_of method for user objects

2006-02-11 Thread Russell Keith-Magee
On 2/11/06, Luke Skibinski Holt <[EMAIL PROTECTED]> wrote: > > > Would it be possible for me to use this function within a template > > {% if user.is_member_of:"blah" %} > > I think calling functions with parameters from within a template was > deliberately not included for security and simplicity

Re: is_member_of method for user objects

2006-02-11 Thread Luke Skibinski Holt
> Would it be possible for me to use this function within a template > {% if user.is_member_of:"blah" %} I think calling functions with parameters from within a template was deliberately not included for security and simplicity reasons. This doesn't stop you from evaluating it in the view or writ

is_member_of method for user objects

2006-02-10 Thread Roberto Aguilar
Hello, I wasn't able to find an easy way to check if a user is a member of a group, so I added the method; here is a patch for: django/django/models/auth.py Index: auth.py === --- auth.py (revision 2296) +++ auth.py (workin