craigds/django-typed-models

Django 1.10: deferred_class_factory no longer exists

Closed this issue · 2 comments

I noticed that after accidentally upgrading to django 1.10 that django-typed-models was squawking at an invalid import. Looks like Django folks either moved it or removed it.

Unhandled exception in thread started by <function wrapper at 0x03EEC970>
Traceback (most recent call last):
  File "C:\Users\dobbyn\PycharmProjects\lantasy\website2\env\lib\site-packages\django\utils\autoreload.py", line 226, in wrapper
    fn(*args, **kwargs)
  File "C:\Users\dobbyn\PycharmProjects\lantasy\website2\env\lib\site-packages\django\core\management\commands\runserver.py", line 113, in inner_run
    autoreload.raise_last_exception()
  File "C:\Users\dobbyn\PycharmProjects\lantasy\website2\env\lib\site-packages\django\utils\autoreload.py", line 249, in raise_last_exception
    six.reraise(*_exception)
  File "C:\Users\dobbyn\PycharmProjects\lantasy\website2\env\lib\site-packages\django\utils\autoreload.py", line 226, in wrapper
    fn(*args, **kwargs)
  File "C:\Users\dobbyn\PycharmProjects\lantasy\website2\env\lib\site-packages\django\__init__.py", line 27, in setup
    apps.populate(settings.INSTALLED_APPS)
  File "C:\Users\dobbyn\PycharmProjects\lantasy\website2\env\lib\site-packages\django\apps\registry.py", line 108, in populate
    app_config.import_models(all_models)
  File "C:\Users\dobbyn\PycharmProjects\lantasy\website2\env\lib\site-packages\django\apps\config.py", line 199, in import_models
    self.models_module = import_module(models_module_name)
  File "C:\Python27\Lib\importlib\__init__.py", line 37, in import_module
    __import__(name)
  File "C:\Users\dobbyn\PycharmProjects\lantasy\website2\src\backend\news\models.py", line 10, in <module>
    from typedmodels.models import TypedModel
  File "C:\Users\dobbyn\PycharmProjects\lantasy\website2\env\lib\site-packages\typedmodels\models.py", line 12, in <module>
    from django.db.models.query_utils import DeferredAttribute, deferred_class_factory
ImportError: cannot import name deferred_class_factory

Looks like it changed in this commit:
django/django@7f51876

That commit seems to work, but proxy tests are failing. I don't have time to continue this right now.