首页 > 代码库 > 向着DJANGO奔跑!
向着DJANGO奔跑!
这个项目明天上半年要弄好,就牛X了哈哈。
平台化运维。PYTHON,SVN,SALTSTACK,.....一锅端~~:)
from django.contrib import admin# Register your models here.from books.models import Publisher, Author, Bookclass 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)
向着DJANGO奔跑!
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。