Merge pull request #35 from fusionbox/django1.6

Another fix for Django 1.6 support

This addresses the removal of CHUNK_SIZE due to https://code.djangoproject.com/ticket/18702 in django/django@70679243d1
fix_request_path_info
Diederik van der Boor 2013-05-25 05:07:23 -07:00
commit f17493ebb9
5 changed files with 15 additions and 2 deletions

View File

@ -7,6 +7,8 @@ python:
env: env:
- DJANGO=django==1.4.5 - DJANGO=django==1.4.5
- DJANGO=django==1.5 - DJANGO=django==1.5
- DJANGO=https://github.com/django/django/archive/master.zip
matrix: matrix:
exclude: exclude:
- python: "3.3" - python: "3.3"

View File

@ -1,6 +1,11 @@
Changelog Changelog
========== ==========
Version 0.5.1
-------------
* Add Django 1.6 support.
Version 0.5 (2013-04-20) Version 0.5 (2013-04-20)
------------------------ ------------------------

View File

@ -11,4 +11,4 @@ Release logic:
6. git commit 6. git commit
7. push to github 7. push to github
""" """
__version__ = "0.5" __version__ = "0.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 # chunk-size: maximum number of objects requested per db-request
# by the polymorphic queryset.iterator() implementation; we use the same chunk size as Django # 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 Polymorphic_QuerySet_objects_per_request = CHUNK_SIZE

View File

@ -193,6 +193,8 @@ class InitTestModelSubclass(InitTestModel):
# models from github issue # models from github issue
class Top(PolymorphicModel): class Top(PolymorphicModel):
name = models.CharField(max_length=50) name = models.CharField(max_length=50)
class Meta:
ordering = ('pk',)
class Middle(Top): class Middle(Top):
description = models.TextField() description = models.TextField()
class Bottom(Middle): class Bottom(Middle):