Suor / handy

Handy django tools
BSD 3-Clause "New" or "Revised" License
85 stars 14 forks source link

Django 1.9 support #14

Closed gregmuellegger closed 8 years ago

gregmuellegger commented 8 years ago

It seems that handy doesn't support Django 1.9. If I try to use the package I get the following error:

Traceback (most recent call last):
  File "runtests.py", line 37, in <module>
    runtests(*sys.argv[1:])
  File "runtests.py", line 24, in runtests
    django.setup()
  File "/home/gregor/projects/oTree/otree-core/.tox/py2.7-django1.9-unittest/lib/python2.7/site-packages/django/__init__.py", line 18, in setup
    apps.populate(settings.INSTALLED_APPS)
  File "/home/gregor/projects/oTree/otree-core/.tox/py2.7-django1.9-unittest/lib/python2.7/site-packages/django/apps/registry.py", line 85, in populate
    app_config = AppConfig.create(entry)
  File "/home/gregor/projects/oTree/otree-core/.tox/py2.7-django1.9-unittest/lib/python2.7/site-packages/django/apps/config.py", line 116, in create
    mod = import_module(mod_path)
  File "/usr/lib64/python2.7/importlib/__init__.py", line 37, in import_module
    __import__(name)
  File "/home/gregor/projects/oTree/otree-core/otree/apps.py", line 11, in <module>
    from otree.models_concrete import StubModel
  File "/home/gregor/projects/oTree/otree-core/otree/models_concrete.py", line 1, in <module>
    from otree.db import models
  File "/home/gregor/projects/oTree/otree-core/otree/db/models.py", line 13, in <module>
    from handy.models import JSONField, PickleField
  File "/home/gregor/projects/oTree/otree-core/.tox/py2.7-django1.9-unittest/lib/python2.7/site-packages/handy/models/__init__.py", line 1, in <module>
    from .fields import *
  File "/home/gregor/projects/oTree/otree-core/.tox/py2.7-django1.9-unittest/lib/python2.7/site-packages/handy/models/fields.py", line 17, in <module>
    from handy.utils import get_module_attr
  File "/home/gregor/projects/oTree/otree-core/.tox/py2.7-django1.9-unittest/lib/python2.7/site-packages/handy/utils.py", line 10, in <module>
    from django.db.models.sql.where import Constraint
ImportError: cannot import name Constraint

Is there any chance that Django 1.9 will be supported in the future?

Suor commented 8 years ago

Fixed this in 54ed9e23014863ec0032c351d4283b144f99bcbe. Please try it with your code.

gregmuellegger commented 8 years ago

Great! Thank you! Is it possible to get out a new release for this package, so that we can pin our dependencies against it?

gregmuellegger commented 8 years ago

@Suor Do you plan to release a new version of this anytime soon so that everyone could use the Django 1.9 support?

Suor commented 8 years ago

Released.