fields.E305 is raised on ManyToManyFields with related_name='+' in models in different apps but with the same name.
Django raises an error during creation a db migration if two models with the same name refer to the same model in m2m field. related_name='+' or 'foo+' don't impact anything.
In some my project there are 50 apps and almost each one has a model with the same name. So I have to come up with a related name and write it in for each m2m field.
Just try to make a migration for my test project
https://github.com/rafick1983/django_related_name_bug
Change History
(7)
Description: |
modified (diff)
|
Summary: |
related_name='+' doesn't work for ManyToMany fields → fields.E305 is raised on ManyToManyFields with related_name='+' in models in different apps but with the same name.
|
Triage Stage: |
Unreviewed → Accepted
|
Owner: |
changed from nobody to Manav Agarwal
|
Status: |
new → assigned
|
Triage Stage: |
Accepted → Ready for checkin
|
Resolution: |
→ fixed
|
Status: |
assigned → closed
|
Thanks for the report. It looks that
app_label
is missing in ManyToManyField.contribute_to_class():