Python之路第四十五篇:django日更
Posted rui
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Python之路第四十五篇:django日更相关的知识,希望对你有一定的参考价值。
from django.contrib import admin from app01.models import * # Register your models here. # @admin.register(Book)#----->单给某个表加一个定制 class MyAdmin(admin.ModelAdmin): list_display = ("title","price","publisher") search_fields = ("title","publisher") list_filter = ("publisher",) ordering = ("price",) fieldsets =[ (None, {‘fields‘: [‘title‘]}), (‘price information‘, {‘fields‘: [‘price‘,"publisher"], ‘classes‘: [‘collapse‘]}), ] admin.site.register(Book,MyAdmin) admin.site.register(Publish) admin.site.register(Author)
以上是关于Python之路第四十五篇:django日更的主要内容,如果未能解决你的问题,请参考以下文章