本文整理汇总了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)
示例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)