Opened 26 hours ago

Last modified 16 hours ago

#36075 assigned Cleanup/optimization

Field.primary_key documentation should details its interaction with CompositePrimaryKey — at Initial Version

Reported by: Simon Charette Owned by:
Component: Documentation Version: dev
Severity: Release blocker Keywords:
Cc: Csirmaz Bendegúz Triage Stage: Accepted
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

A particular focus should be put on the fact that the flag will and should only be set to True if the field is the single member of the primary key. When a composite primary is defined on the model this flag will be False for all the fields defined on the model and _meta.pk_fields (which should be documented) should be used instead to build composite primary key ready third-party application.

In other words, it should be made clear that code that relies on Field.primary_key is not composite field ready and that _meta.pk_fields should be used instead.

Change History (0)

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