Code

Opened 6 years ago

Closed 6 years ago

Last modified 6 years ago

#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: UI/UX:

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_view_patch.diff (598 bytes) - added by chrj 6 years ago.

Download all attachments as: .zip

Change History (5)

Changed 6 years ago by chrj

comment:1 Changed 6 years ago by brosner

  • Keywords nfa-someday added; newforms-admin removed
  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Triage Stage changed from Unreviewed to Design decision needed
  • Version changed from SVN to newforms-admin

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.

comment:2 Changed 6 years ago by Bela Hausmann <post@…>

  • Cc post@… added

comment:3 Changed 6 years ago by jkocherhans

  • Resolution set to invalid
  • Status changed from new to closed

This shouldn't be necessary after [7275].

comment:4 Changed 6 years ago by Bela Hausmann <post@…>

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!

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.