March 2020
Intermediate to advanced
608 pages
17h 17m
English
Create an admin.py file in which we will define the administration interface for the Category model. It will extend DjangoMpttAdmin instead of admin.ModelAdmin, as follows:
# myproject/apps/categories/admin.pyfrom django.contrib import adminfrom django_mptt_admin.admin import DjangoMpttAdminfrom .models import Category@admin.register(Category)class CategoryAdmin(DjangoMpttAdmin): list_display = ["title", "created", "modified"] list_filter = ["created"]
Read now
Unlock full access