From a711cc64ec86bbe669e6e154e0ca569a934d60f1 Mon Sep 17 00:00:00 2001 From: vinit Kumar Date: Thu, 19 Nov 2015 13:13:47 +0530 Subject: [PATCH 1/2] fixes #8, deprecation for GenericForeignKey in Django1.9 and bump version This commit introduces a backward compatible import where the warning is removed for django1.8 and ensure that the project will run on Django1.9 when the support for GenericForeignKey will be removed from the generic module in contenttype. --- dj_elastictranscoder/__init__.py | 2 +- dj_elastictranscoder/models.py | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/dj_elastictranscoder/__init__.py b/dj_elastictranscoder/__init__.py index ecc0ae4..4033697 100644 --- a/dj_elastictranscoder/__init__.py +++ b/dj_elastictranscoder/__init__.py @@ -1 +1 @@ -__version__ = '0.9.3' +__version__ = '0.9.4' diff --git a/dj_elastictranscoder/models.py b/dj_elastictranscoder/models.py index ee35afc..3c59403 100644 --- a/dj_elastictranscoder/models.py +++ b/dj_elastictranscoder/models.py @@ -1,6 +1,9 @@ from django.db import models from django.contrib.contenttypes.models import ContentType -from django.contrib.contenttypes.generic import GenericForeignKey +if django.version > 1.8: + from django.contrib.contenttypes.fields import GenericForeignKey +else: + from django.contrib.contenttypes.generic import GenericForeignKey class EncodeJob(models.Model): From ef59c4f0fab72777faced23efa15e415724a8614 Mon Sep 17 00:00:00 2001 From: vinit Kumar Date: Thu, 19 Nov 2015 13:36:12 +0530 Subject: [PATCH 2/2] fix the checks and typos --- dj_elastictranscoder/models.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dj_elastictranscoder/models.py b/dj_elastictranscoder/models.py index 3c59403..8920e04 100644 --- a/dj_elastictranscoder/models.py +++ b/dj_elastictranscoder/models.py @@ -1,6 +1,7 @@ from django.db import models from django.contrib.contenttypes.models import ContentType -if django.version > 1.8: +import django +if django.get_version() > '1.8': from django.contrib.contenttypes.fields import GenericForeignKey else: from django.contrib.contenttypes.generic import GenericForeignKey