Links to FKs in Admin (proposal)
|Reported by:||Vlada Macek||Owned by:||nobody|
|Has patch:||no||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
I frequently miss the admin ability to automatically link to change_forms of objects referenced by FKs:
Currently when a ForeignKey field is in list_display, the target's
__unicode__ is called and displayed in the cell. Why not to as well make it a link to the target's change_form provided it has ModelAdmin registered and the user has the permissions?
Can be controlled by some new attribute of ModelAdmin, say
as the tuple of such fields.
Yes, I can currently simulate that by creating a model method for each foreign key returning
allow_tags=True and replace the FK field in list_display, but these fields are second grade citizens:
- cannot be ordered by
- cannot be filtered upon
- defining them is tedious
- the quickiest dirty way is to hardcode the target URL to
Sorry if it's duplicate or the feature is already in. Was unable to find it.
Change History (3)
comment:1 Changed 7 years ago by
|Patch needs improvement:||unset|
|Status:||new → closed|