码迷,mamicode.com
首页 > 其他好文 > 详细

向着DJANGO奔跑!

时间:2014-11-08 13:14:01      阅读:329      评论:0      收藏:0      [点我收藏+]

标签:style   blog   http   io   color   ar   sp   div   on   

这个项目明天上半年要弄好,就牛X了哈哈。

平台化运维。PYTHON,SVN,SALTSTACK,.....一锅端~~:)

from django.contrib import admin

# Register your models here.
from books.models import Publisher, Author, Book

class AuthorAdmin(admin.ModelAdmin):
    list_display = (first_name, last_name, email)
    search_fields = (first_name, last_name)

class BookAdmin(admin.ModelAdmin):
    list_display = (title, publisher,publication_date)
    list_filter = (publication_date,)
    date_hierarchy = publication_date
    ordering = (-publication_date,)
    fields = (title, authors, publisher, )
    filter_horizontal = (authors,)
    raw_id_fields = (publisher, )

admin.site.register(Publisher)
admin.site.register(Author, AuthorAdmin)
admin.site.register(Book, BookAdmin)

bubuko.com,布布扣bubuko.com,布布扣

 

向着DJANGO奔跑!

标签:style   blog   http   io   color   ar   sp   div   on   

原文地址:http://www.cnblogs.com/aguncn/p/4082979.html

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