#8618: Many-to-many intermediary tables can't have multiple foreign keys to
source/target models
-------------------------------------+-------------------------------------
Reporter: coda | Owner: nobody
Type: New feature | Status: new
Component: Database layer | Version: master
(models, ORM) | Resolution:
Severity: Normal | Triage Stage: Accepted
Keywords: m2m intermediary | Needs documentation: 0
validation | Patch needs improvement: 0
Has patch: 0 | UI/UX: 0
Needs tests: 0 |
Easy pickings: 0 |
-------------------------------------+-------------------------------------
Comment (by danny.adair@…):
> 1) Convention: the foreign key _without_ a related field is the field
for the M2M relation every time.
> 2) A new option; something in the Meta class to identify the fields that
should be used for the through.
> [...]
> Another option(which I'm not necessarily endorsing), would be to make
through accept a tuple, the first arg is the intermediary model and the
second is the name of the fkey to this model, and the third is the name of
the fkey to the other model.
I find the third option to be the most natural notation. Also, I wonder
what notation the first two options would have for an intermediary table
that describes more than one M2M relationship...
--
Ticket URL: <https://code.djangoproject.com/ticket/8618#comment:12>
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 post to this group, send email to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.