Opened 16 years ago

Closed 16 years ago

Last modified 16 years ago

#7795 closed (wontfix)

QuerySet used instead of Admin.manager.get_queryset()

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

Description

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 16 years ago.
trunk_wrong-queryset.patch (1.1 KB ) - added by xek 16 years ago.

Download all attachments as: .zip

Change History (7)

by xek, 16 years ago

Attachment: trunk_wrong-queryset.patch added

comment:1 by Malcolm Tredinnick, 16 years ago

milestone: 1.0 alpha

This isn't 1.0-alpha.

comment:2 by Eric Holscher, 16 years ago

milestone: post-1.0
Triage Stage: UnreviewedDesign decision needed

comment:3 by Malcolm Tredinnick, 16 years ago

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 by Karen Tracey, 16 years ago

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 by (none), 16 years ago

milestone: post-1.0

Milestone post-1.0 deleted

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