#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)
Change History (7)
by , 16 years ago
Attachment: | newforms-admin_wrong-queryset.patch added |
---|
by , 16 years ago
Attachment: | trunk_wrong-queryset.patch added |
---|
comment:1 by , 16 years ago
milestone: | 1.0 alpha |
---|
comment:2 by , 16 years ago
milestone: | → post-1.0 |
---|---|
Triage Stage: | Unreviewed → Design decision needed |
comment:3 by , 16 years ago
Resolution: | → wontfix |
---|---|
Status: | new → closed |
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 , 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.
This isn't 1.0-alpha.