python - django user group from request user -


i have assigned user group developer , in admin want query like:

user_group = request.user.groups 

its giving me auth.group.none though have assigned user in group.

why getting none while have assigned user group

as matth pointed out here https://stackoverflow.com/a/2245908/5936450 use following (slightly altered example):

user_group = request.user.groups.values_list('name', flat=true) 

Comments

Popular posts from this blog

xml - Extract substrings with XSLT -

math - "ELO Rating" and how does "TSR Rating" work? -

How can do a tuple comparison in coffeescript similar to that in python? -