jrief / django-admin-sortable2

Generic drag-and-drop ordering for objects in the Django admin interface
https://django-admin-sortable2.readthedocs.io/en/latest/
Other
773 stars 180 forks source link

adminsortable2 - TemplateNotFound #360

Closed belthaZornv closed 1 year ago

belthaZornv commented 1 year ago

After installing the library, and adding to the apps and all the necessities; I've been faced with this error:

TemplateDoesNotExist at /platform/flow/flow/add/
adminsortable2/edit_inline/tabular-django-3.2.html

That seems to come from this:

class SortableTabularInline(SortableInlineAdminMixin, admin.TabularInline):
    template = 'adminsortable2/edit_inline/tabular-django-{0}.{1}.html'.format(*DJANGO_VERSION)

Is there something I'm missing?

My code:

class FlowActionInline(SortableTabularInline, admin.TabularInline):
    fields = ('action',)

    model = FlowAction
marksweb commented 1 year ago

Seems valid. I can see one template, but the code you've referenced is loading different templates.

jrief commented 1 year ago

Apparently you attempted to use django-admin-sortable2 with Django-3.2.

Version 2 only works with Django-4.0 and later.