parent
893759f7d0
commit
ece9876a47
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
VERSION = (1, 4, 0) # following PEP 386
|
||||
VERSION = (1, 4, 1) # following PEP 386
|
||||
DEV_N = None
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -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]
|
||||
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
return u'{0} : {1}'.format(self.title, self.content_object)
|
||||
|
|
|
|||
Loading…
Reference in New Issue