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:
@@ -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
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user