码迷,mamicode.com
首页 > 编程语言 > 详细

Python之路【第四十五篇】:django日更

时间:2020-03-05 01:34:49      阅读:106      评论:0      收藏:0      [点我收藏+]

标签:info   isp   lte   ice   一个   code   class   none   classes   

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日更

标签:info   isp   lte   ice   一个   code   class   none   classes   

原文地址:https://www.cnblogs.com/hackerer/p/12417124.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!