Shai Berger
unread,Jan 12, 2016, 4:22:34 PM1/12/16Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to django-d...@googlegroups.com
On Tuesday 12 January 2016 21:38:09 Luis Masuelli wrote:
> Currently, if I want to create a ManyToMany relationship, I'm stuck with
> two options:
>
>
> - Accept the by-default configuration. This will imply the inner table
> will have two fields based on the respective PKs.
> - Create a through-model. I will be able to specify two foreign keys,
> one for each table. I will lose the ability to cal .add and .delete.
>
> Is there a chance to let the user specify custom to_field (and say,
> "from_field") in a M2M field? I think it would be a nice feature, as we
> already allow them in FK and O2O fields.
Personally, I'd like it better if add() could still be used with an explicit
through model, provided that instances of the through model could be created
using only the two FK values -- applying limitations only where they are
actually needed on one hand, and keeping a clean separation between the
default, implicit thruogh model on one hand, and all the customizations and
configurations you can imagine on the other hand.
My 2 cents,
Shai.