day 53

python终端创建

python manage.py createsuperuser

from django.contrib import admin

# Register your models here.

from 项目 import models
admin.site.register(表名)
admin.site.register(models.Author)
admin.site.register(models.Book)
admin.site.register(models.Publish)

自定制
class  bookadmin(admin.ModelAdmin):
list_display = ('di','price','name','pub_data')
list_per_page = (1)分页
search_fields = ('id','name')收索
在定义类时候verbose_name='姓名

猜你喜欢

转载自www.cnblogs.com/yikedashuyikexiaocao/p/10164907.html
今日推荐