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.
|
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
|
- Django 1.5 compatibility
|
||||||
|
- Support for Generic Inlines (thanks @Hedde!)
|
||||||
|
|
||||||
|
|
||||||
### Future
|
### Future
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
VERSION = (1, 4, 0) # following PEP 386
|
VERSION = (1, 4, 1) # following PEP 386
|
||||||
DEV_N = None
|
DEV_N = None
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,8 @@
|
||||||
import json
|
import json
|
||||||
|
|
||||||
from django import VERSION as DJANGO_VERSION
|
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]
|
DJANGO_MINOR_VERSION = DJANGO_VERSION[1]
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -64,12 +64,14 @@ class Note(Sortable):
|
||||||
|
|
||||||
#a generic bound model
|
#a generic bound model
|
||||||
class GenericNote(SimpleModel, Sortable):
|
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")
|
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):
|
class Meta(Sortable.Meta):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def __unicode__(self):
|
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