本文整理汇总了Python中django.contrib.admin.sites.AdminSite.index_template方法的典型用法代码示例。如果您正苦于以下问题:Python AdminSite.index_template方法的具体用法?Python AdminSite.index_template怎么用?Python AdminSite.index_template使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类django.contrib.admin.sites.AdminSite
的用法示例。
在下文中一共展示了AdminSite.index_template方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: AdminSite
# 需要导入模块: from django.contrib.admin.sites import AdminSite [as 别名]
# 或者: from django.contrib.admin.sites.AdminSite import index_template [as 别名]
from django.contrib import admin
from django.contrib.admin.sites import AdminSite
import core
import core.admin
site = AdminSite("settings") # pylint: disable-msg=C0103
site.index_template = "settings/index.html"
site.app_index_template = "settings/app_index.html"
site.register((
core.models.Semester,
core.models.Group,
))
site.register(core.models.Subject, core.admin.SubjectAdmin)
# site.register(core.models.Lesson, LessonAdmin)
示例2: AdminSite
# 需要导入模块: from django.contrib.admin.sites import AdminSite [as 别名]
# 或者: from django.contrib.admin.sites.AdminSite import index_template [as 别名]
] # each specified field should be either a BooleanField, CharField, DateField, DateTimeField, IntegerField or ForeignKey.
# inlines = [ChoiceInline]
# date_hierarchy = 'pub_date'
search_fields = ["entry"]
list_per_page = 30
# prepopulated_fields = {"comment": ("entry",)} # may be just for SlugField
radio_fields = {"pack_by": admin.HORIZONTAL}
# readonly_fields = ['add_date']
form = YummyForm
admin_site = AdminSite()
admin_site.register(Category)
admin_site.register(Package)
admin_site.register(Yummy, MyYummyAdmin)
admin_site.index_template = "min_admin.html"
# admin.site.register(Poll)
# class PollAdmin(admin.ModelAdmin):
# fields = ['pub_date', 'question']
#
# admin.site.register(Poll, PollAdmin)
# class PollAdmin(admin.ModelAdmin):
# fieldsets = [
# (None, {'fields': ['question']}),
# ('Date information', {'fields': ['pub_date']}),
# ]
# admin.site.register(Poll, PollAdmin)
# class ChoiceInline(admin.TabularInline):
# model = Choice
# extra = 3
示例3: AdminSite
# 需要导入模块: from django.contrib.admin.sites import AdminSite [as 别名]
# 或者: from django.contrib.admin.sites.AdminSite import index_template [as 别名]
'''Defines the three AdminSite.
Created on Feb 8, 2013
@author: Cam Moore
'''
from django.contrib.admin.sites import AdminSite
challenge_designer_site = AdminSite(name="Challenge Designer Admin")
challenge_designer_site.index_template = "admin/designer_index.html"
challenge_manager_site = AdminSite(name="Challenge Manager Admin")
challenge_manager_site.index_template = "admin/admin_index.html"
sys_admin_site = AdminSite(name='System Administration Admin')
developer_site = AdminSite(name="Developer Admin")
developer_site.index_template = "admin/developer_index.html"
示例4: import
# 需要导入模块: from django.contrib.admin.sites import AdminSite [as 别名]
# 或者: from django.contrib.admin.sites.AdminSite import index_template [as 别名]
from django.contrib.admin.options import StackedInline, TabularInline
from django.contrib.admin.sites import AdminSite
from django.contrib.admin.filters import (ListFilter, SimpleListFilter,
FieldListFilter, BooleanFieldListFilter, RelatedFieldListFilter,
ChoicesFieldListFilter, DateFieldListFilter, AllValuesFieldListFilter)
import os
import copy
from django.conf import settings
from django.utils.importlib import import_module
from django.utils.module_loading import module_has_submodule
BASE_DIR = os.path.dirname(os.path.dirname(__file__))
site = AdminSite()
site.index_template=BASE_DIR+"/templates/admin/index.html"
site.register(User, UserAdmin)
def autodiscover():
"""
Autodiscover function from django.contrib.admin
"""
for app in settings.INSTALLED_APPS:
mod = import_module(app)