code: def has_group(user, group_name):
      '''
      This allows specification group-based permissions in templates.
      In most instances, creating model-based permissions and giving
      them to the desired group is preferable.
      '''
      if user.groups.filter(name=group_name).exists():
          return True
      return Falsf has_group(user, group_name):
      '''
      This allows specification group-based permissions in templates.
      In most instances, creating model-based permissions and giving
      them to the desired group is preferable.
      '''
      if user.groups.filter(name=group_name).exists():
          return True
      return False
docs: This allows specification group-based permissions in templates.
      In most instances, creating model-based permissions and giving
      them to the desired group is preferable.