django model的设计

1 设计blog的显示界面: 在blog/admin.py修改

from django.contrib import admin
from blog.models import BlogPost
# Register your models here.
class blogAdmin(admin.ModelAdmin):
	list_display = ['title','body','timestamp'] # display fields
	search_fields = ['title']
	list_filter = ['timestamp']
admin.site.register(BlogPost,blogAdmin)

2 界面显示如下:

 

posted @ 2017-05-09 15:42  liuzhipenglove  阅读(183)  评论(0编辑  收藏  举报