I think it should be pretty easy to do.

The get_form() method on ModelAdmin returns the form, and it knows
about the current request. So you could modify that to remove the
field after the form is generated.


class MyModelAdmin(admin.ModelAdmin):

    def get_form(self, request, obj=None, **kwargs):
        form = super(MyModelAdmin,self).get_form(request, obj,
**kwargs)
        if request.uesr.is_super_user:
            del form.fields['whatever']
        return form

admin.site.register(MyModel, MyModelAdmin)
-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.


Reply via email to