Refactor join, fix owner on added fks on through model, fix coverage, add .coveragerc settings.

This commit is contained in:
collerek
2021-01-16 12:02:11 +01:00
parent 0fe95b0c7b
commit 28cc847b57
5 changed files with 163 additions and 174 deletions

View File

@ -32,13 +32,13 @@ def adjust_through_many_to_many_model(model_field: Type[ManyToManyField]) -> Non
model_field.to,
real_name=parent_name,
ondelete="CASCADE",
owner=model_field.owner,
owner=model_field.through,
)
model_field.through.Meta.model_fields[child_name] = ForeignKey(
model_field.owner,
real_name=child_name,
ondelete="CASCADE",
owner=model_field.owner,
owner=model_field.through,
)
create_and_append_m2m_fk(