Re: Show a model on the admin list index page

2014-10-07 Thread Andrea
I think I've found the problem. In my Django version I have in `contrib/admin/sites.py` line 371: has_module_perms = user.has_module_perms(app_label) Here it is instead: https://github.com/django/django/blob/master/django/contrib/admin/sites.py line 383: has_module_perms = model_admin.has_modul

Re: Show a model on the admin list index page

2014-10-07 Thread Daniel Rus Morales
I think it’s clear to me what you are trying to do. By overriding those methods in BarAdmin you go down that line (bypass the django admin permission system), but to get the app listed in the admin index page you would have to actually rewrite the view function. This view function makes an expli

Re: Show a model on the admin list index page

2014-10-07 Thread Andrea
Dear Daniel, I want to answer to an issue you raised in your previous message. The Bar model doesn’t appear in the App index list page because the view > function in charge first verifies whether the user has any of the > add/change/delete permissions granted for such App, and given that your > u

Re: Show a model on the admin list index page

2014-10-07 Thread Andrea
Dear Daniel, thank you for your answer. I think I was not clear enough in explaining my problem. I will try to rephrase the problem, please tell me if from the first message this point was clear or seemed different. I do want that the user is able to add or change some objects. My goal is to bypa

Re: Show a model on the admin list index page

2014-10-07 Thread Daniel Rus Morales
Hi Andrea, I answer below in between lines. On 07 Oct 2014, at 08:53, Andrea wrote: > Let's suppose I have a Foo app with a Bar model with a owner field. I want a > user to be able to edit all the instances for which obj.owner == request.user. > > The model appears correctly in the admin pane

Show a model on the admin list index page

2014-10-06 Thread Andrea
Let's suppose I have a Foo app with a Bar model with a owner field. I want a user to be able to edit all the instances for which obj.owner == request.user. The model appears correctly in the admin panel for superusers and for users for which I have explicitly assigned the permission change_bar or