Opened 6 years ago

Closed 6 years ago

Last modified 5 years ago

#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: master
Severity: Keywords:
Cc: Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:


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"),)"



Attachments (1)

13418-r13135.diff (2.0 KB) - added by ramiro 6 years ago.

Download all attachments as: .zip

Change History (6)

comment:1 Changed 6 years ago by russellm

  • milestone set to 1.2
  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Triage Stage changed from Unreviewed to Accepted

Changed 6 years ago by ramiro

comment:2 Changed 6 years ago by ramiro

  • Has patch set

comment:3 Changed 6 years ago by Alex

  • Triage Stage changed from Accepted to Ready for checkin

comment:4 Changed 6 years ago by russellm

  • Resolution set to fixed
  • Status changed from new to closed

(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.

comment:5 Changed 5 years ago by jacob

  • milestone 1.2 deleted

Milestone 1.2 deleted

Note: See TracTickets for help on using tickets.
Back to Top