Opened 13 years ago
Closed 13 years ago
#19084 closed Uncategorized (wontfix)
Allow sorting by PK in admin
| Reported by: | Ram Rachum | Owned by: | nobody |
|---|---|---|---|
| Component: | contrib.admin | Version: | |
| Severity: | Normal | Keywords: | |
| Cc: | Triage Stage: | Unreviewed | |
| Has patch: | no | Needs documentation: | no |
| Needs tests: | no | Patch needs improvement: | no |
| Easy pickings: | no | UI/UX: | no |
Description
When I make the Django admin show a "PK" column, it doesn't let me sort by that column, despite the fact that it does allow sorting by "ID", which is usually identical.
Please allow sorting by the PK as well.
Note:
See TracTickets
for help on using tickets.
pkis a property on model instances, not a model field.To enable sorting, we'd have to somehow set
pk.admin_order_fieldto the_meta.pk.attname. I don't see how to achieve that — especially since core shouldn't contain code for contrib apps such as the admin.Just use the real model field!