Allow add/create on m2m intermediate tables if all the non-FK fields have defaults or are NULLable
|Reported by:||pihentagy||Owned by:||nobody|
|Component:||Database layer (models, ORM)||Version:||master|
|Severity:||Normal||Keywords:||manytomany through default add create|
|Has patch:||no||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
Description (last modified by russellm)
Add/create is currently disabled on m2m relations that use an intermediate table. This is due to the fact that values to populate the intermediate table cannot be provided using the add/create calls.
However, what if the intermediate model has reasonable default values, so
one can assign model A to B without extra info?
In my case, I just want to syncronize 2 databases, and I would like to
mark relationships, that are already synced. So, in my case, the
intermediate table contains a boolean, which defaults to false, and
will become true, when the data is synced.
In this case adding relations without explicitly creating the intermediate table would be great.
(based on this thread in the ML)
Change History (6)
comment:1 Changed 7 years ago by Alex
- Needs documentation unset
- Needs tests unset
- Patch needs improvement unset
- Triage Stage changed from Unreviewed to Accepted
comment:2 Changed 7 years ago by russellm
- Description modified (diff)
- Summary changed from Allow add/create if all the non-FK fields have defaults or are NULLable to Allow add/create on m2m intermediate tables if all the non-FK fields have defaults or are NULLable