user group template tag django

Solutions on MaxInterview for user group template tag django by the best coders in the world

showing results for - "user group template tag django"
Florencia
24 Feb 2016
1from django import template
2
3register = template.Library() 
4
5@register.filter(name='has_group') 
6def has_group(user, group_name):
7    return user.groups.filter(name=group_name).exists()