clokep / django-querysetsequence

Chain multiple (disparate) QuerySets in Django
https://django-querysetsequence.readthedocs.io/
ISC License
107 stars 25 forks source link

Support Django 3.0 ( / drop support for Django 1.11 / Python 2.7) #58

Closed alfredo-ardito closed 4 years ago

alfredo-ardito commented 4 years ago

I'm getting this error from Django 3.0 from django.utils import six ImportError: cannot import name 'six' from 'django.utils' How should we fix it?

clokep commented 4 years ago

This package hasn't yet been updated to support Django 3.0 (and dropping support for Python 2.7 / Django 1.11). It is on my todo list, but I don't know when I'll get to it. Unfortunately it is somewhat difficult to support both Django 3.0 and Django 1.11 at the same time, which are both current versions of Django. Any help would be appreciated.

alfredo-ardito commented 4 years ago

okay. In the mean while to make it work I changed line 15

from django.utils import six with import six

and line 254 from

if low_mark is not 0: to if low_mark != 0:

clokep commented 4 years ago

@alfredo-ardito Why the change to the low_mark comparison? (None of the tests fail without that change, see #59.)

alfredo-ardito commented 4 years ago

the low_mark comparison is not obviously an error. I get this warning running: python manage.py runserver

/var/venv/lib/python3.8/site-packages/queryset_sequence/init.py:255: SyntaxWarning: "is not" with a literal. Did you mean "!="?
if low_mark is not 0:

For this reason I did that change, maybe, not strictly necessary.

clokep commented 4 years ago

Ah! Interesting. That might be new with Python 3.8, I don't see that when running the tests in 3.7 at least. I'll look into that separately.