Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"ImportError: No module named related" on latest django 1.8 #22

Closed
asermax opened this issue Apr 28, 2015 · 3 comments
Closed

"ImportError: No module named related" on latest django 1.8 #22

asermax opened this issue Apr 28, 2015 · 3 comments

Comments

@asermax
Copy link

asermax commented Apr 28, 2015

Aparently the django.db.models.related module was moved/removed/merged on latest django versions, which causes a import error when trying to use the filter backend.

@DanielFerreiraJorge
Copy link

Same here:

In filterset.py, replace the import:
from django.db.models.related import RelatedObject

by:
from django.db.models.fields.related import ForeignObjectRel

Also, replace all occurrences of RelatedObject by ForeignObjectRel in the file

@bstempi
Copy link

bstempi commented May 8, 2015

I'll see if I can get some time to put together a PR for this, but I saw this on some other issue:

try:
from django.db.models.related import RelatedObject as ForeignObjectRel
except:
# django 1.8 +
from django.db.models.fields.related import ForeignObjectRel

That would allow it to work for both Django 1.7 and 1.8.

The other issue: jazzband/django-simple-history#156

How they applied the fix: jazzband/django-simple-history@c634386

@philipn
Copy link
Owner

philipn commented May 13, 2015

This should now be fixed. It looks like I'd forgotten to push a new release to PyPI.

@philipn philipn closed this as completed May 13, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants