From 899097da976855adecee9658805d1cf4a887feae Mon Sep 17 00:00:00 2001 From: Vinit Kumar Date: Wed, 9 Dec 2015 12:08:58 +0530 Subject: [PATCH] Update models.py 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/models.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/dj_elastictranscoder/models.py b/dj_elastictranscoder/models.py index ee35afc..8920e04 100644 --- a/dj_elastictranscoder/models.py +++ b/dj_elastictranscoder/models.py @@ -1,6 +1,10 @@ from django.db import models from django.contrib.contenttypes.models import ContentType -from django.contrib.contenttypes.generic import GenericForeignKey +import django +if django.get_version() > '1.8': + from django.contrib.contenttypes.fields import GenericForeignKey +else: + from django.contrib.contenttypes.generic import GenericForeignKey class EncodeJob(models.Model):