1. David Larlet
  2. django-roa

Commits

Ianare SEVI  committed d471957

fixes for loading in django1.6

  • Participants
  • Parent commits 1688bcd
  • Branches default

Comments (0)

Files changed (2)

File django_roa/db/models.py

View file
  • Ignore whitespace
 from django.db.models.base import ModelBase, subclass_exception, \
     get_absolute_url, method_get_order, method_set_order
 from django.db.models.fields.related import OneToOneField
-from django.utils.functional import curry, update_wrapper
+from django.utils.functional import curry
+from functools import update_wrapper
+	
 from django.utils.encoding import force_unicode, smart_unicode
 
 from restkit import Resource, RequestFailed, ResourceNotFound

File django_roa/db/query.py

View file
  • Ignore whitespace
 from django.conf import settings
 from django.db.models import query
 from django.core import serializers
-from django.db.models.sql.constants import LOOKUP_SEP
+# Django >= 1.5
+try:
+	from django.db.models.constants import LOOKUP_SEP
+#Django < 1.4
+except:
+	from django.db.models.sql.constants import LOOKUP_SEP
 from django.db.models.query_utils import Q
 from django.utils.encoding import force_unicode
 
-from restkit import Resource, ResourceNotFound, RequestFailed
+from restkit import Resource, ResourceNotFound
 from django_roa.db.exceptions import ROAException, ROANotImplementedYetException
 
 logger = logging.getLogger("django_roa")