MnogoByte / django-permanent

Yet another approach to creation of non-deletable and non-removable from db restorable django models.
71 stars 20 forks source link

Error on django > 3 when django-utils-six is not installed #78

Open jasperoosthoek opened 3 years ago

jasperoosthoek commented 3 years ago

After installing django-permanent in a docker container I tried to import:

from django_permanent.models import PermanentModel

and got this error:

ImportError                               Traceback (most recent call last)
<ipython-input-2-3bd377b0f254> in <module>
----> 1 from django_permanent.models import PermanentModel

/usr/local/lib/python3.8/site-packages/django_permanent/models.py in <module>
      3 from django.db.models.deletion import Collector
      4 from . import settings
----> 5 from .deletion import *  # NOQA
      6 from .related import *  # NOQA
      7 from .query import NonDeletedQuerySet, DeletedQuerySet, PermanentQuerySet

/usr/local/lib/python3.8/site-packages/django_permanent/deletion.py in <module>
      7 from django.db.models import signals, sql
      8 from django.db.models.deletion import Collector
----> 9 from django.utils import six
     10 from django.utils.timezone import now
     11 from django import VERSION as DJANGO_VERSION

After installing django-utils-six I was able to import PermanentModel

pip install django-utils-six

More context: https://stackoverflow.com/questions/59193514/importerror-cannot-import-name-six-from-django-utils