#35956: Add composite foreign keys
-------------------------------------+-------------------------------------
Reporter: Csirmaz Bendegúz | Type: New
| feature
Status: new | Component: Database
| layer (models, ORM)
Version: dev | Severity: Normal
Keywords: | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
This is a follow up to #373 (CompositePrimaryKey).
Now that composite primary keys are merged, it would be great to be able
to create foreign keys referencing them through the Django ORM.
My proposal is to add 2 parameters to `ForeignKey`: `from_fields` and
`to_fields`.
They would map to the underlying `ForeignObject`'s `from_fields`,
`to_fields` parameters.
If a `ForeignKey` has multiple fields, it acts as a ''virtual field'',
meaning it doesn't create a database column automatically.
--
Ticket URL: <https://code.djangoproject.com/ticket/35956>
Django <https://code.djangoproject.com/>
The web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion visit
https://groups.google.com/d/msgid/django-updates/010701937a59f135-926c081e-5010-4ee7-822b-adbfddc990bd-000000%40eu-central-1.amazonses.com.