added generic inlines support

This commit is contained in:
intelliadmin
2013-03-15 10:10:01 +01:00
parent ddbeca7177
commit 279477da7b
5 changed files with 38 additions and 3 deletions
+12
View File
@@ -1,6 +1,8 @@
import json
from django import VERSION as DJANGO_VERSION
from django.contrib.contenttypes.generic import GenericStackedInline, GenericTabularInline
DJANGO_MINOR_VERSION = DJANGO_VERSION[1]
from django.conf import settings
@@ -238,3 +240,13 @@ class SortableTabularInline(SortableInlineBase, TabularInline):
class SortableStackedInline(SortableInlineBase, StackedInline):
"""Custom template that enables sorting for stacked inlines"""
template = 'adminsortable/edit_inline/stacked.html'
class SortableGenericTabularInline(SortableInlineBase, GenericTabularInline):
"""Custom template that enables sorting for tabular inlines"""
template = 'adminsortable/edit_inline/tabular.html'
class SortableGenericStackedInline(SortableInlineBase, GenericStackedInline):
"""Custom template that enables sorting for stacked inlines"""
template = 'adminsortable/edit_inline/stacked.html'