Reputation: 25193
I have certain fields that I would only like displayed to certain admins when they are in the admin site. I am looking into using list_display
to do this but first need to figure out a way of determining which user is currently viewing the admin site.
Upvotes: 0
Views: 142
Reputation: 28752
Unless you pass the request object everywhere, the solution is generally to use thread local storage and some middleware that updates the value on each request.
http://djangosnippets.org/snippets/2179/
Upvotes: 1