Re: [Django] #36092: Composite primary key wrongly allows non-local fields to be referenced (was: Composite primary key creates invalid migration when one of its fields is inherited)

5 views
Skip to first unread message

Django

unread,
Jan 12, 2025, 11:25:24 PM1/12/25
to django-...@googlegroups.com
#36092: Composite primary key wrongly allows non-local fields to be referenced
-------------------------------------+-------------------------------------
Reporter: Jacob Walls | Owner: (none)
Type: Bug | Status: new
Component: Database layer | Version: dev
(models, ORM) |
Severity: Release blocker | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Simon Charette):

* stage: Unreviewed => Accepted
* summary:
Composite primary key creates invalid migration when one of its fields
is inherited
=> Composite primary key wrongly allows non-local fields to be
referenced

Comment:

The crux of the issue here is that `CompositePrimaryKey` allows non-local
field to be referenced. Fields inherited from an abstract based should be
allowed to be referenced but ones from a concrete base (aka non-local /
defined on a referenced table) should not.
--
Ticket URL: <https://code.djangoproject.com/ticket/36092#comment:1>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
Reply all
Reply to author
Forward
0 new messages