﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
6020	Allow group comparing with basestring	italomaia <italo.maia@…>	nobody	"Sometimes, i have to check is a user is in a particular group(from auth), and i have to load the group
i'm checking against, before i can use the ""in"" operator. Something like this:
{{{
MyGroupName=""badass_people""
group=Group.objects.get(name=MyGroupName) 
if group in user.groups:
    ...
else:
    ...
}}}
I would like to suggest the overwrite of the method __cmp__, so that something like this:
{{{
group=""badass_people""
if group in user.groups:
    ...
else:
    ...
}}}


I believe the code to do so is something like this:

{{{
class Group(models.Model):
    #stuff stuff ...
    def __cmp__(self, group):
        if isinstance(group, basestring):
            return cmp(self.name,group)
    #more stuff...
}}}"		closed	Contrib apps	dev		wontfix	auth, group, improvement		Design decision needed	0	0	0	0	0	0
