On Apr 29, 6:10 am, akonsu <ako...@gmail.com> wrote:
> hello,
>
> in my custom admin class that inherits ModelAdmin i need to set
> ModelAdmin.exclude, ModelAdmin.list_display, etc based on whether the
> logged in user is a superuser or not.
>
> is this possible?
>
> thanks
> konstantin
>

ModelAdmin provides a get_form method that you can override to return
a different form class depending on the user - it is passed the
request object, so you can access the user from there.
--
DR.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

Reply via email to