Hello, Rodrigo >From looking at the ModelAdmin source code[1], I think all you need to do is reimplement the queryset() method in your subclass on admin.py.
Make sure you return a filtered queryset based on request.user. I never use the admin, so I'm not so sure about how the user will be accessible from the admin, so maybe someone else will have to explain the final steps. Cheers, AT [1] https://code.djangoproject.com/browser/django/trunk/django/contrib/admin/options.py#L214 On Thu, Nov 3, 2011 at 8:35 PM, Rodrigo Cea <rodrigo...@gmail.com> wrote: > Explanation: > > I have 3 models: Client, Project and Task. Each Client has 1 or more > Projects. Each Project has 1 or more Tasks. > > A Client can only see the Projects assigned to him and the Tasks assigned > to one of his Projects. This is already working, overriding "queryset" in > the ModelAdmin instance. > > However, in the changelist for Tasks, there is a list_filter on Projects, > so a Client can view the Tasks that are assigned to a certain Project. > > THE PROBLEM: this 'Project' filter shows all Projects, whether they're > assigned to the Client or not. I need it to only show the Projects assigned > to the Client. > > Thanks, > > Rodrigo > > > > -- > You received this message because you are subscribed to the Google Groups > "Django users" group. > To view this discussion on the web visit > https://groups.google.com/d/msg/django-users/-/xO-ARZBOXp4J. > To post to this group, send email to django-users@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. > -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@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.