From 71767431ebe662985816aeb69e8988c5847be8a2 Mon Sep 17 00:00:00 2001 From: Gavin Wahl Date: Fri, 24 May 2013 15:13:34 -0600 Subject: [PATCH 1/4] Django 1.6 support CHUNK_SIZE has been removed from Django, so set it ourself if it can't be imported. --- polymorphic/query.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/polymorphic/query.py b/polymorphic/query.py index 22cadf0..7f6d70d 100644 --- a/polymorphic/query.py +++ b/polymorphic/query.py @@ -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 From 93bc9fecdf4e121bd6b47070e593aa274ae82be2 Mon Sep 17 00:00:00 2001 From: Gavin Wahl Date: Fri, 24 May 2013 15:13:57 -0600 Subject: [PATCH 2/4] Run travis tests on django dev --- .travis.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.travis.yml b/.travis.yml index 94d9412..54e966f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,6 +7,8 @@ python: env: - DJANGO=django==1.4.5 - DJANGO=django==1.5 + - DJANGO=https://github.com/django/django/archive/master.zip + matrix: exclude: - python: "3.3" From 7f2111c20101e1488cfa8e6c39a27131b375c569 Mon Sep 17 00:00:00 2001 From: Gavin Wahl Date: Fri, 24 May 2013 15:17:44 -0600 Subject: [PATCH 3/4] assertQuerysetEquals requires an ordered queryset --- polymorphic/tests.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/polymorphic/tests.py b/polymorphic/tests.py index 2935368..376f0f3 100644 --- a/polymorphic/tests.py +++ b/polymorphic/tests.py @@ -193,6 +193,8 @@ class InitTestModelSubclass(InitTestModel): # models from github issue class Top(PolymorphicModel): name = models.CharField(max_length=50) + class Meta: + ordering = ('pk',) class Middle(Top): description = models.TextField() class Bottom(Middle): From 1958146f10653ae075fa09ffcb8b46d3be3b3bb4 Mon Sep 17 00:00:00 2001 From: Gavin Wahl Date: Fri, 24 May 2013 15:37:01 -0600 Subject: [PATCH 4/4] Increase version and add django 1.6 support to the changelog --- docs/changelog.rst | 5 +++++ polymorphic/__version__.py | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/docs/changelog.rst b/docs/changelog.rst index 44ded5f..6fa06e0 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -1,6 +1,11 @@ Changelog ========== +Version 0.5.1 +------------- + +* Add Django 1.6 support. + Version 0.5 (2013-04-20) ------------------------ diff --git a/polymorphic/__version__.py b/polymorphic/__version__.py index 451a48a..2800cab 100644 --- a/polymorphic/__version__.py +++ b/polymorphic/__version__.py @@ -11,4 +11,4 @@ Release logic: 6. git commit 7. push to github """ -__version__ = "0.5" +__version__ = "0.5.1"