diff --git a/README.md b/README.md index 640f7f5..e1a0ae6 100644 --- a/README.md +++ b/README.md @@ -154,8 +154,9 @@ ordering on top of that just seemed a little much in my opinion. django-admin-sortable is currently used in production. -### What's new in 1.4? +### What's new in 1.4.1? - Django 1.5 compatibility +- Support for Generic Inlines (thanks @Hedde!) ### Future diff --git a/adminsortable/__init__.py b/adminsortable/__init__.py index 49aa0c8..8720e30 100755 --- a/adminsortable/__init__.py +++ b/adminsortable/__init__.py @@ -1,4 +1,4 @@ -VERSION = (1, 4, 0) # following PEP 386 +VERSION = (1, 4, 1) # following PEP 386 DEV_N = None diff --git a/adminsortable/admin.py b/adminsortable/admin.py index 937b286..651eddc 100644 --- a/adminsortable/admin.py +++ b/adminsortable/admin.py @@ -1,7 +1,8 @@ import json from django import VERSION as DJANGO_VERSION -from django.contrib.contenttypes.generic import GenericStackedInline, GenericTabularInline +from django.contrib.contenttypes.generic import (GenericStackedInline, + GenericTabularInline) DJANGO_MINOR_VERSION = DJANGO_VERSION[1] diff --git a/sample_project/app/models.py b/sample_project/app/models.py index a1ea4f1..0f972b8 100644 --- a/sample_project/app/models.py +++ b/sample_project/app/models.py @@ -64,12 +64,14 @@ class Note(Sortable): #a generic bound model class GenericNote(SimpleModel, Sortable): - content_type = models.ForeignKey(ContentType, verbose_name=u"Content type", related_name="generic_notes") + 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', fk_field='object_id') + content_object = generic.GenericForeignKey(ct_field='content_type', + fk_field='object_id') class Meta(Sortable.Meta): pass def __unicode__(self): - return u"%s : %s" % (self.title, self.content_object) \ No newline at end of file + return u'{0} : {1}'.format(self.title, self.content_object)