Django 1.6 support

CHUNK_SIZE has been removed from Django, so set it ourself if it can't
be imported.
This commit is contained in:
Gavin Wahl
2013-05-24 15:13:34 -06:00
parent ef1feab709
commit 71767431eb
+5 -1
View File
@@ -15,7 +15,11 @@ from .query_translate import translate_polymorphic_field_path
# chunk-size: maximum number of objects requested per db-request
# by the polymorphic queryset.iterator() implementation; we use the same chunk size as Django
from django.db.models.query import CHUNK_SIZE # this is 100 for Django 1.1/1.2
try:
from django.db.models.query import CHUNK_SIZE # this is 100 for Django 1.1/1.2
except ImportError:
# CHUNK_SIZE was removed in Django 1.6
CHUNK_SIZE = 100
Polymorphic_QuerySet_objects_per_request = CHUNK_SIZE