djangonauts / django-hstore

PostgreSQL HStore support for Django.
http://django-hstore.readthedocs.io/
Other
517 stars 142 forks source link

Incompatibility with Django 1.6 #11

Closed DemersM closed 10 years ago

DemersM commented 10 years ago

django-hstore seems to be not compatible with Django 1.6

C:\Python27\lib\site-packages\django_orm\postgresql\hstore\forms.py:2: Deprecati onWarning: django.utils.simplejson is deprecated; use json instead. from django.utils import simplejson as json

Unhandled exception in thread started by <function wrapper at 0x02E3B3B0> Traceback (most recent call last): File "C:\Python27\lib\site-packages\django\utils\autoreload.py", line 93, in w rapper fn(_args, _kwargs) File "C:\Python27\lib\site-packages\django\core\management\commands\runserver. py", line 98, in inner_run self.validate(display_num_errors=True) File "C:\Python27\lib\site-packages\django\core\management\base.py", line 310, in validate num_errors = get_validation_errors(s, app) File "C:\Python27\lib\site-packages\django\core\management\validation.py", lin e 34, in get_validation_errors for (app_name, error) in get_app_errors().items(): File "C:\Python27\lib\site-packages\django\db\models\loading.py", line 196, in get_app_errors self._populate() File "C:\Python27\lib\site-packages\django\db\models\loading.py", line 78, in _populate self.load_app(app_name) File "C:\Python27\lib\site-packages\django\db\models\loading.py", line 99, in load_app models = import_module('%s.models' % app_name) File "C:\Python27\lib\site-packages\django\utils\importlib.py", line 40, in im port_module import(name) File "c:\mygeosite\geodjango\basqui\models.py", line 13, in from shapefile.models import File "c:\mygeosite\geodjango\shapefile\models.py", line 3, in from django_orm.postgresql import hstore File "C:\Python27\lib\site-packages\django_orm\postgresql\hstoreinit.py", line 2, in from django_orm.postgresql.hstore.managers import HStoreManager File "C:\Python27\lib\site-packages\django_orm\postgresql\hstore\managers.py", line 2, in from django_orm.postgresql.hstore.query import HStoreQuerySet File "C:\Python27\lib\site-packages\django_orm\postgresql\hstore\query.py", li ne 54, in from django_orm.cache.query import CachedQuerySet File "C:\Python27\lib\site-packages\django_orm\cache\query.py", line 4, in <mo dule> from django.db.models.query import ITER_CHUNK_SIZE ImportError: cannot import name ITER_CHUNK_SIZE

logbear commented 10 years ago

I replaced from django.db.models.query import ITER_CHUNK_SIZE

with:

try: from django.db.models.query import ITER_CHUNK_SIZE except: from django.db.models.sql.constants import GET_ITERATOR_CHUNK_SIZE as ITER_CHUNK_SIZE

on that file. Hope it helps.

nemesifier commented 10 years ago

should be fixed!