当前位置: 首页>>代码示例>>Python>>正文


Python AdminSite.site_header方法代码示例

本文整理汇总了Python中django.contrib.admin.AdminSite.site_header方法的典型用法代码示例。如果您正苦于以下问题:Python AdminSite.site_header方法的具体用法?Python AdminSite.site_header怎么用?Python AdminSite.site_header使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在django.contrib.admin.AdminSite的用法示例。


在下文中一共展示了AdminSite.site_header方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: PageAdmin

# 需要导入模块: from django.contrib.admin import AdminSite [as 别名]
# 或者: from django.contrib.admin.AdminSite import site_header [as 别名]
class PageAdmin(admin.ModelAdmin):
    inlines = [PageInline]

class MenuAdmin(admin.ModelAdmin):
    inlines = [MenuInline]

admin.site.register(Student, MyUserAdmin)
admin.site.register(Course)
admin.site.register(Group, GroupAdmin)
admin.site.register(Enroll, EnrollAdmin)
admin.site.register(Period)
admin.site.register(Category)
admin.site.register(MenuItem, MenuAdmin)
admin.site.register(Page, PageAdmin)

admin.site.site_header = _("Academica administrator site")


admin_site = AdminSite(name='matricula_admin')
admin_site.site_header = _("Academica administrator site")


admin_site.register(Student, MyUserAdmin)
admin_site.register(Course)
admin_site.register(Group, GroupAdmin)
admin_site.register(Enroll, EnrollAdmin)
admin_site.register(Period)
admin_site.register(Category)
admin_site.register(MenuItem, MenuItemAdmin)
admin_site.register(Page, PageAdmin)
开发者ID:ChicoMTZ,项目名称:academica,代码行数:32,代码来源:admin.py

示例2: AttendanceAdmin

# 需要导入模块: from django.contrib.admin import AdminSite [as 别名]
# 或者: from django.contrib.admin.AdminSite import site_header [as 别名]
    list_filter = ["category_id", "designation"]
    inlines = [AttendanceInline]


class AttendanceAdmin(admin.ModelAdmin):
    list_display = ("employee_id", "date", "shift", "project")
    list_filter = ["employee_id", "date", "project"]


class PaymentAdmin(admin.ModelAdmin):
    list_display = ("paid_date", "amount", "paid_details", "project_id")
    list_filter = ["project_id", "amount", "paid_date"]


class EmpPaymentAdmin(admin.ModelAdmin):
    list_display = ("employee", "amount", "type", "month", "year")
    list_filter = ["employee", "month", "year"]


site = AdminSite()
site.site_header = "Omar and Assosciates"

site.register(Project, ProjectAdmin)
site.register(Category)
site.register(Dealer)
site.register(Expense, ExpenseAdmin)
site.register(Employee, EmployeeAdmin)
site.register(Attendance, AttendanceAdmin)
site.register(EmployeePayment, EmpPaymentAdmin)
site.register(Payment, PaymentAdmin)
开发者ID:mhaleemullah,项目名称:ica,代码行数:32,代码来源:admin_custom.py


注:本文中的django.contrib.admin.AdminSite.site_header方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。