How to do it...

Create an administration interface for the Category model from the categories app that extends treebeard.admin.TreeAdmin instead of admin.ModelAdmin and uses a custom form factory, as follows:

# myproject/apps/categories/admin.py
from
django.contrib import admin
from treebeard.admin import TreeAdmin
from treebeard.forms import movenodeform_factory

from .models import Category

@admin.register(Category)
class CategoryAdmin(TreeAdmin):
form = movenodeform_factory(Category)
list_display = ["title", "created", "modified"]
list_filter = ["created"]
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.117.227.194