paulocheque / django-dynamic-fixture

A complete library to create dynamic model instances for testing purposes.
http://django-dynamic-fixture.readthedocs.io/
Other
391 stars 67 forks source link

FieldDoesNotExist Import No Longer Valid #135

Closed chris-umed closed 3 years ago

chris-umed commented 4 years ago

In Django 3.1 FieldDoesNotExist is no longer available via django.db.models.fields

It has to be imported from the source file: from django.core.exceptions import FieldDoesNotExist

This is the error I get: from django_dynamic_fixture.django_helper import get_related_model, \ vi +12 .local/share/virtualenvs/tern-KsBtVxbD/lib/python3.7/site-packages/django_dynamic_fixture/django_helper.py # from django.db.models.fields import NOT_PROVIDED, AutoField, FieldDoesNotExist ImportError: cannot import name 'FieldDoesNotExist' from 'django.db.models.fields'

chris-umed commented 4 years ago

Just seen there is a PR for this: https://github.com/paulocheque/django-dynamic-fixture/pull/134

It would be hugely appreciated if this could be reviewed and merged.

JanMalte commented 4 years ago

https://docs.djangoproject.com/en/3.1/releases/3.1/#id1