Describe the bug
excpetion occue when from tortoise.filters import get_m2m_filters
python3.8 x64
Ubuntu 16.04 18.04
To Reproduce
Expected behavior
No error
Additional context
In [1]: from tortoise.filters import get_m2m_filters
---------------------------------------------------------------------------
ImportError Traceback (most recent call last)
<ipython-input-1-4ed7453a3d83> in <module>
----> 1 from tortoise.filters import get_m2m_filters
/usr/local/lib/python3.8/dist-packages/tortoise/__init__.py in <module>
23 OneToOneFieldInstance,
24 )
---> 25 from tortoise.filters import get_m2m_filters
26 from tortoise.models import Model
27 from tortoise.queryset import QuerySet
/usr/local/lib/python3.8/dist-packages/tortoise/filters.py in <module>
5 from pypika import Table
6 from pypika.functions import Upper
----> 7 from pypika.terms import (
8 BasicCriterion,
9 Criterion,
ImportError: cannot import name 'basestring' from 'pypika.terms' (/usr/local/lib/python3.8/dist-packages/pypika/terms.py)
but tortoise-orm==0.16.5 has not this problem
or pip3 install -U pypika==0.37.1
pypika remove basestring in https://github.com/kayak/pypika/pull/413/files/b44d70c2bdcedcc7526c39ee782664db9b9c4264
Thanks for reporting! I'll make hotfix for this issue and will be fixed with next release
Oh my. This was me. basestring isn't really a thing anymore, a regular str should be perfectly fine.
This should be fixed in our develop branch.
Please test by installing pip install https://github.com/tortoise/tortoise-orm/archive/develop.zip
Thanks @lntuition ! (it was actually him)
That helped me. Thanks
This should be fixed in our develop branch.
Please test by installing
pip install https://github.com/tortoise/tortoise-orm/archive/develop.zipThanks @lntuition ! (it was actually him)
Hi I released 0.16.10 with the fix :smile:
Most helpful comment
Hi I released 0.16.10 with the fix :smile: