Tumblelog by Soup.io
Newer posts are loading.
You are at the newest post.
Click here to check if anything new just came in.

Remove named field from fieldsets

This snipped removes a specific fields from the fieldsets. This is very useful to leave a field 'out' in the admin, likewise:

def get_fieldsets(self, request, obj=None):
    fieldsets = super(BlaModelAdmin, self).get_fieldsets(request, obj)

    if not request.user.has_perm('change_blah'):
        remove_from_fieldsets(fieldsets, ('blah',))

Don't be the product, buy the product!

Schweinderl