Skip to content

Commit

Permalink
Merge pull request #65 from vparitskiy/master
Browse files Browse the repository at this point in the history
fix warning on GenericForeignKey import for Django >= 1.8
  • Loading branch information
valdergallo committed Aug 19, 2015
2 parents 7d40f20 + 778c3ed commit 287bc3f
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions data_importer/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,11 @@
from django.http import HttpResponse
from django.conf import settings
from django.contrib.contenttypes.models import ContentType
from django.contrib.contenttypes import generic

try:
from django.contrib.contenttypes.fields import GenericForeignKey
except ImportError:
from django.contrib.contenttypes.generic import GenericForeignKey # for Django < 1.9


DATA_IMPORTER_TASK = hasattr(settings, 'DATA_IMPORTER_TASK') and settings.DATA_IMPORTER_TASK or 0
Expand Down Expand Up @@ -46,7 +50,7 @@ class FileHistory(models.Model):

content_type = models.ForeignKey(ContentType, null=True, blank=True)
object_id = models.PositiveIntegerField(null=True, blank=True)
content_object = generic.GenericForeignKey('content_type', 'object_id')
content_object = GenericForeignKey('content_type', 'object_id')

class Meta:
verbose_name_plural = 'File Histories'
Expand Down

0 comments on commit 287bc3f

Please sign in to comment.