#35956: Add composite foreign keys
-------------------------------------+-------------------------------------
Reporter: Csirmaz Bendegúz | Owner: (none)
Type: New feature | Status: new
Component: Database layer | Version: dev
(models, ORM) |
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by Csirmaz Bendegúz):
Replying to [comment:7 Clifford Gama]:
> In simple cases, having the foreign key automatically infer and create
the needed fields is great developer experience — it keeps things
intuitive and close to how ForeignKey works today.
I think I agree, but it's going to be a lot more complex to implement
> It can be useful, but in very specific cases, like, say modeling tight
tenant-scoped relationships — i.e., when you know the tenant in both FKs
is always the same and want to enforce that via shared fields.
Yeah that's what I meant, in a multi-tenant database you never want one
tenant's records to point to another tenant's records
--
Ticket URL: <https://code.djangoproject.com/ticket/35956#comment:9>
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/010701965a2e08f3-abacdb63-89fb-4860-a951-f5a61329bc45-000000%40eu-central-1.amazonses.com.