You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have tried creating a doubly-nested sorted inline admin using:
from django.contrib import admin
from translated_fields import TranslatedFieldAdmin
from nested_admin import NestedStackedInline
from adminsortable2.admin import SortableInlineAdminMixin
class LineInline(TranslatedFieldAdmin, SortableInlineAdminMixin, NestedTabularInline):
model = Line
extra = 0
class StanzaInline(TranslatedFieldAdmin, SortableInlineAdminMixin, NestedTabularInline):
model = Stanza
inlines = [
LineInline,
]
extra = 0
@admin.register(Poem)
class PoemAdmin(TranslatedFieldAdmin, NestedModelAdmin):
inlines = [
StanzaInline,
]
adminsortable2 throws an ImproperlyConfigured error (and rightfully so):
Class poems.admin.<class 'poems.admin.StanzaInline'> must also derive from admin.TabularInline or admin.StackedInline
nested_admin derives NestedTabularInline from InlineModelAdmin as can be seen here.
It appears that inheriting both the django and nested_admin classes prevents the adminsortable2 exception, but this breaks the nested admin inlines in the admin page:
class LineInline(TranslatedFieldAdmin, SortableInlineAdminMixin, NestedTabularInline, admin.TabularInline):
...
class StanzaInline(TranslatedFieldAdmin, SortableInlineAdminMixin, NestedTabularInline, admin.TabularInline):
Figuring out exactly how to work around this is way above my experience and skill, but I am very eager to assist in any way I can.
I have tried creating a doubly-nested sorted inline admin using:
adminsortable2 throws an
ImproperlyConfigured
error (and rightfully so):nested_admin derives
NestedTabularInline
fromInlineModelAdmin
as can be seen here.It appears that inheriting both the django and nested_admin classes prevents the
adminsortable2
exception, but this breaks the nested admin inlines in the admin page:Figuring out exactly how to work around this is way above my experience and skill, but I am very eager to assist in any way I can.
Is there a way to get the django-nested-admin and django-admin-sortable2 plugins to work together?
I'm using:
The text was updated successfully, but these errors were encountered: