Display link to change-form on inlines where model is registered in admin site
|Reported by:||Simon Meers||Owned by:||Simon Meers|
|Cc:||sree@…, cg@…, glicerinu@…||Triage Stage:||Accepted|
|Has patch:||yes||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
If an inline object has a
get_absolute_url method, a 'View on site' link is displayed.
Here I propose that if an inline object is registered in the same admin site, an 'Edit' link is displayed in a similar fashion.
- The inline may only display a subset of fields, so the user may wish to go to the full change form
- 'Recursive inlines' can be accessed more easily -- e.g.
The attached patch shows a draft implementation.
- Do we need to check if the user has change permissions on that model before displaying the link? (in the unlikely event that the user has permission to change a model which displays the inlines of a model which they do not have change permissions for). Given that I cannot see a straightforward way of checking for this without the addition of a template tag/filter, and the rarity of such setups, I'd be happy to let the user click the link and get a permission denied page.
- Do we need an
InlineModelAdminoption for enabling/disabling this link? E.g.
InlineModelAdmin.show_admin_link. Or are we happy to have it enabled globally?
[ Edit ]a sufficiently understandable link label? Would "Edit in Admin", or "Display full form" or something be more appropriate?
I think the reciprocal of this would also be very useful --
ForeignKey widgets could display an
 link beside the "add new" (green +) link which links to the change form for the selected parent object.
Change History (27)
comment:2 Changed 7 years ago by
|Component:||django.contrib.admin → User Experience|
|Triage Stage:||Unreviewed → Accepted|
comment:20 Changed 3 years ago by
|Patch needs improvement:||unset|