Opened 7 years ago
Last modified 7 years ago
#28839 closed Cleanup/optimization
Model.__repr__ should include the pk — at Initial Version
Reported by: | Álex Córcoles | Owned by: | nobody |
---|---|---|---|
Component: | Database layer (models, ORM) | Version: | 1.11 |
Severity: | Normal | Keywords: | |
Cc: | Collin Anderson | Triage Stage: | Unreviewed |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
This was proposed on https://code.djangoproject.com/ticket/1055 , but it was fixed without including the PK. It was also suggested in https://code.djangoproject.com/ticket/20448 , but ignored.
I think the PK is very valuable as repr, as it allows you to retrieve the object unambiguously; while str really can't have a good default implementation.
Note:
See TracTickets
for help on using tickets.