March 2020
Intermediate to advanced
608 pages
17h 17m
English
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.pyfrom django.contrib import adminfrom treebeard.admin import TreeAdminfrom treebeard.forms import movenodeform_factoryfrom .models import Category@admin.register(Category)class CategoryAdmin(TreeAdmin): form = movenodeform_factory(Category) list_display = ["title", "created", "modified"] list_filter = ["created"]