#13418 closed (fixed)
Natural keys documentation: 1) tuple requirement in serialization is missing, 2) use unique_together
Reported by: | hunajakippo | Owned by: | nobody |
---|---|---|---|
Component: | Documentation | Version: | dev |
Severity: | Keywords: | ||
Cc: | Triage Stage: | Ready for checkin | |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
As discussed {1} I propose following changes to natural keys (de)serialization documentation {2}:
1) mention requirement to use tuple also in natural keys/serialization section (currently this is only mentioned in deserialization).
- For example: "A natural key is a tuple of values that can be used to uniquely identify an object instance without using the primary key value"
2) in the example model define Person first_name and last_name as unique_together.
- For example: "class Meta: unique_together = (("first_name", "last_name"),)"
{1} http://groups.google.com/group/django-users/browse_thread/thread/2d2aed5d45d48a94
{2} http://docs.djangoproject.com/en/dev/topics/serialization/#natural-keys
Attachments (1)
Change History (6)
comment:1 by , 15 years ago
milestone: | → 1.2 |
---|---|
Triage Stage: | Unreviewed → Accepted |
by , 15 years ago
Attachment: | 13418-r13135.diff added |
---|
comment:2 by , 15 years ago
Has patch: | set |
---|
comment:3 by , 15 years ago
Triage Stage: | Accepted → Ready for checkin |
---|
comment:4 by , 15 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
Note:
See TracTickets
for help on using tickets.
(In [13146]) Fixed #13418 -- Added notes on uniqueness requirements for natural keys. Thanks to hunajakippo for the suggestion, and Ramiro Morales for the draft text.