#6323 closed (invalid)
A change_view should use self.queryset_change to lookup the object
Reported by: | chrj | Owned by: | nobody |
---|---|---|---|
Component: | contrib.admin | Version: | newforms-admin |
Severity: | Keywords: | nfa-someday | |
Cc: | post@… | 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
In my opinion, a change_view should use self.queryset_change to lookup the object. This way, the queryset_change method could also be used to restrict access to the change_view (as i think it was intended?).
I have attached a short patch.
Attachments (1)
Change History (5)
by , 17 years ago
Attachment: | change_view_patch.diff added |
---|
comment:1 by , 17 years ago
Keywords: | nfa-someday added; newforms-admin removed |
---|---|
Triage Stage: | Unreviewed → Design decision needed |
Version: | SVN → newforms-admin |
comment:2 by , 17 years ago
Cc: | added |
---|
comment:3 by , 17 years ago
Resolution: | → invalid |
---|---|
Status: | new → closed |
This shouldn't be necessary after [7275].
comment:4 by , 17 years ago
In my opinion, this is not really fixed.
For example: I have a public_objects manager (which is the default manager) and I have my normal objects manager (which includes more objects than the public manger) which I want to use in the Administration. When I overload the queryset method I see all objects in the changelist view, but objects which are not in the default manager can not be edited or deleted because those views still look up the default manager!
This is a good idea. However, to make this really worth while there will need to be some changes to how the admin interface works in
AdminSite
. Instead of linking to the models the navigation system could be improved to link to arbitrary
ModelAdmin
objects that may all have different views on to the objects of the model. This would also help make row level permissions possible. Tagging as nfa-someday so it can be looked at when the bigger picture gets looked at.