创建admin配置类
from django.contrib import admin
from a.models import Person
class ArticleAdmin(admin.ModelAdmin):
list_display('title', 'content')
# list_display 同时支持tuple和list
# 注意字段名field, 必须写对
admin.site.register(Article, ArticleAdmin)
过滤器: 此过滤器非彼过滤器
from django.contrib import admin
from a.models import Person
class ArticleAdmin(admin.ModelAdmin):
list_display('title', 'content')
list_filter('title', )
# list_display 同时支持tuple和list
# 注意字段名field, 必须写对
admin.site.register(Article, ArticleAdmin)