question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Reverse accessor clashes

See original GitHub issue

Having 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:closed
  • Created 7 years ago
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
jpiccommented, Nov 25, 2016

Instead of importing City at the top, could you try that ?

city = models.OneToOneField('cities_light.City', verbose_name=_('city'))

​ 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.

1reaction
max-arnoldcommented, Jul 26, 2017

It looks like the issue was related to misconfiguration, closing.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found