Using the django admin, I would like to be able to specify which models a user sees when he logs in. For a stretch goal, for each model t开发者_如何学运维ypes a user can see, I would like to specify a filter to limit which instances of the model the user can see.
Could someone please provide a pointer for how to go about achieving this?
You can specify which models the user can see and manipulate using the admin itself. You can do this when you're logged in as a superuser.
Regarding your stretch goal, a simple answer is detailed here.
Take a look at group-level permissions in the Admin (scroll down). Django 1.2 has introduced hooks for object-level permissions too
精彩评论