Refactored admin url patterns to be compatible with Django 1.8 or higher.

Refactored sample_project imports to be compatible with Django 1.9
Updated unit tests for get_next/previous.
Version bump to 2.0.8.
Fixed typo in docs.
This commit is contained in:
Brandon Taylor
2015-12-21 14:11:13 -05:00
parent ba9e477f2f
commit 698ca136d5
5 changed files with 41 additions and 20 deletions
+8 -2
View File
@@ -1,4 +1,10 @@
from django.contrib.contenttypes import generic
from django import VERSION
if VERSION < (1, 9):
from django.contrib.contenttypes.generic import GenericForeignKey
else:
from django.contrib.contenttypes.fields import GenericForeignKey
from django.contrib.contenttypes.models import ContentType
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
@@ -109,7 +115,7 @@ class GenericNote(SimpleModel, SortableMixin):
content_type = models.ForeignKey(ContentType,
verbose_name=u"Content type", related_name="generic_notes")
object_id = models.PositiveIntegerField(u"Content id")
content_object = generic.GenericForeignKey(ct_field='content_type',
content_object = GenericForeignKey(ct_field='content_type',
fk_field='object_id')
order = models.PositiveIntegerField(default=0, editable=False)