Confusion between list_display and list_display_links for 'id' field
|Reported by:||master||Owned by:||nobody|
|Cc:||Triage Stage:||Ready for checkin|
|Has patch:||yes||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
In a ModelAdmin class, define list_display with 'id' and some other fields.
If 'id' is the first field, define list_display_link with some fields but without 'id',
otherwise you can omit list_display_link.
Problem : The 'id' column is rendered as a second hidden <input> (the 'correct' hidden input is still at the end of the <tr>) and the value is not shown.
Workaround : To have a correct screen when 'id' is in list_display, it has to be in list_display_link as well (either explicity or when a default list_display_link takes it as the first field of list_display).
Change History (16)
comment:1 Changed 7 years ago by
|Patch needs improvement:||unset|
comment:3 Changed 6 years ago by
|Status:||closed → reopened|
|Summary:||Confusion between list_display and list_display_link for 'id' field → Confusion between list_display and list_display_links for 'id' field|
|Version:||1.1 → 1.2-beta|