Reverse accessor clashes
See original GitHub issueHaving imported everything as I oughta, I get the following:
ERRORS:
cities_light.City.country: (fields.E304) Reverse accessor for 'City.country' clashes with reverse accessor for 'City.country'.
HINT: Add or change a related_name argument to the definition for 'City.country' or 'City.country'.
cities_light.City.region: (fields.E304) Reverse accessor for 'City.region' clashes with reverse accessor for 'City.region'.
HINT: Add or change a related_name argument to the definition for 'City.region' or 'City.region'.
cities_light.Region.country: (fields.E304) Reverse accessor for 'Region.country' clashes with reverse accessor for 'Region.country'.
HINT: Add or change a related_name argument to the definition for 'Region.country' or 'Region.country'.
pandion_api.City.country: (fields.E304) Reverse accessor for 'City.country' clashes with reverse accessor for 'City.country'.
HINT: Add or change a related_name argument to the definition for 'City.country' or 'City.country'.
pandion_api.City.region: (fields.E304) Reverse accessor for 'City.region' clashes with reverse accessor for 'City.region'.
HINT: Add or change a related_name argument to the definition for 'City.region' or 'City.region'.
pandion_api.Region.country: (fields.E304) Reverse accessor for 'Region.country' clashes with reverse accessor for 'Region.country'.
HINT: Add or change a related_name argument to the definition for 'Region.country' or 'Region.country'.
Am I doing something wrong here?
Issue Analytics
- State:
- Created 7 years ago
- Comments:6 (1 by maintainers)
Top Results From Across the Web
Django: reverse accessors for foreign keys clashing
Everything I've read says that setting the related_name should prevent the clash, but I'm still getting the same error. Can anyone think of...
Read more >Error Reverse accessor for Analysis assign user clashes with ...
I have two Django models which inherit from a base class: - Request - Inquiry - Analysis. Request has two foreign keys to...
Read more >22850 (False reverse accessor clash with inherited classes)
it crashes: Unhandled exception in thread started by <function wrapper at 0x105daab90> Traceback (most recent call last): File ...
Read more >[Solved]-Reverse accessor clashes in Django-django
[Solved]-Reverse accessor clashes in Django-django ... But I am not getting the reason for you having both password and username having fk relation...
Read more >How to handle clashing reverse accessors between two 3rd ...
Modify django-allauth's models to fix the related_name clash · Do the migration for django-user-account -> django-allauth · Revert django-allauth's models.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Instead of importing City at the top, could you try that ?
Don’t set CITIES_LIGHT_APP_NAME unless you want to override the models: in your example it’s just a relation to the default City models that you need.
It looks like the issue was related to misconfiguration, closing.