Opened 10 years ago

Closed 10 years ago

Last modified 9 years ago

#7795 closed (wontfix)

QuerySet used instead of Admin.manager.get_queryset()

Reported by: xek Owned by: nobody
Component: contrib.admin Version: master
Severity: Keywords:
Cc: Triage Stage: Design decision needed
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:


this prevents me from modifying the admin search behaviour by setting a custom Manager

patches for trunk and new-forms branch attached.

Attachments (2)

newforms-admin_wrong-queryset.patch (1.0 KB) - added by xek 10 years ago.
trunk_wrong-queryset.patch (1.1 KB) - added by xek 10 years ago.

Download all attachments as: .zip

Change History (7)

Changed 10 years ago by xek

Changed 10 years ago by xek

Attachment: trunk_wrong-queryset.patch added

comment:1 Changed 10 years ago by Malcolm Tredinnick

milestone: 1.0 alpha

This isn't 1.0-alpha.

comment:2 Changed 10 years ago by Eric Holscher

milestone: post-1.0
Triage Stage: UnreviewedDesign decision needed

comment:3 Changed 10 years ago by Malcolm Tredinnick

Resolution: wontfix
Status: newclosed

This was apparently an intentional choice so that people could set restrictive querysets for the default manager and still edit objects through the admin. Changing it now would be backwards incompatible.

It is documented that the admin does not use custom model managers.

comment:4 Changed 10 years ago by Karen Tracey

Also, you can override the queryset used by the Admin by overriding the default queryset method on your ModelAdmin object. The use of the full unrestricted QuerySet() removed in the patch is one where it is combined with the the ModelAdmin queryset for the search, so any restrictions you place on the ModelAdmin queryset will carry through to the search behavior (unless I'm missing something). I think this is more already fixed or invalid rather than wontfix, though the lack of specifics in the original description make me hesitant to say that with 100% certainty.

comment:5 Changed 9 years ago by (none)

milestone: post-1.0

Milestone post-1.0 deleted

Note: See TracTickets for help on using tickets.
Back to Top