Add
Based on an answer here: <http://stackoverflow.com/a/6288863>
- groups
Based on an answer here: <http://stackoverflow.com/a/6288863>
FieldStack simplifies forms template rendering. This is enhanced version of snippet [1786](http://djangosnippets.org/snippets/1786/)
This snippet was inspired by [1783](http://www.djangosnippets.org/snippets/1783/). It allows simply create groups of fields for template rendering.
This snippet provides support to create a bit more advanced forms, eg group fields together vertically and horizontally. It's a bit similar to the options one has about displaying fields in the admin.
This snippet provides a @group_required decorator. You can pass in multiple groups, for example: @group_required('admins','editors') def myview(request, id): ... Note: the decorator is based on the snippet [here](http://fragmentsofcode.wordpress.com/2008/12/08/django-group_required-decorator/) but extends it checking first that the user is logged in before testing for group membership - [user_passes_test](http://docs.djangoproject.com/en/dev/topics/auth/#django.contrib.auth.decorators.user_passes_test) does not check for this by default. It is important to check that the user is first logged in, as anonymous users trigger an AttributeError when the groups filter is executed.
Based on [this snippet](http://www.djangosnippets.org/snippets/876/). More clean, with links to the related admin forms. Nice example on customization of contributed django admin apps. It adds the following to the user list interface: fields for is_superuser and is_staff, last login time; by default, short names of groups user is in (mousehover to see full names) It adds the following to the to group list interface: list of users in your groups. To enable, just put it somewhere and import it from your main urls.py: import utils/admin_auth.py
Add-on for auth app of newforms-admin branch, adding more information about users and their groups at user and group list in admin interface. Also, nice example on customization of contributed django admin apps. It adds the following to the user list interface: fields for is_superuser and is_staff, last login time; by default, short names of groups user is in (mousehover to see full names) It adds the following to the to group list interface: list of users in your groups. To enable, just put it somewhere and import it from your main urls.py: import useradmin
Simple little flatpage wrapper view that lets you easily block off certain areas of flatpages to only a certain user group. Allows superuser in as well.
8 snippets posted so far.