Snippet List
Add fields and extend Django's built-in `Group` model using a `OneToOneField` (i.e. a profile model). In this example, we add a `UUIDField`. Whenever a new group is created, we automatically (via signals) create a corresponding `Role` record referencing the newly created group. Whenever a Group is deleted, the corresponding Role is deleted as well.
Sometimes you just don't want to display every permission django has, you just want a short list showing the permissions for some of your apps (or even django core apps).
GROUP_PERMISSIONS_MODELS must be a list of your app models. Dotted path (in lowercase) required, app name + model *class* name.
This tag builds on top of the [ifusergroup/else tag](http://www.djangosnippets.org/snippets/390/), fixes a small bug and introduces support for else blocks. This adds a way to provide multiple groups via group1|group2|group3
- tag
- templatetag
- user
- auth
- group
Allows you to search if a user belongs to a given group.
Along the same lines as snippet [390](http://www.djangosnippets.org/snippets/390/), but uses a regular ``if`` tag so it is more flexible.
(Updated for efficiency. Running a boolean test on a QuerySet avoids a bit of unnecessary overhead.)
(Updated to accept a list of groups.)
11 snippets posted so far.