本文整理匯總了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)