Opened 4 years ago

Last modified 4 years ago

#32294 closed Bug

related_name='+' doesn't work for ManyToMany fields — at Version 1

Reported by: Aleksey Ruban Owned by: nobody
Component: Database layer (models, ORM) Version: 3.1
Severity: Normal Keywords:
Cc: Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: yes UI/UX: no

Description (last modified by Aleksey Ruban)

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 (1)

comment:1 by Aleksey Ruban, 4 years ago

Description: modified (diff)
Note: See TracTickets for help on using tickets.
Back to Top