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


Python AdminSite.index_template方法代码示例

本文整理汇总了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)
开发者ID:t0ster,项目名称:emark,代码行数:18,代码来源:admin.py

示例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
开发者ID:too,项目名称:xiaosp,代码行数:33,代码来源:admin.py

示例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"
开发者ID:KendyllD,项目名称:boukenda-project,代码行数:20,代码来源:admin.py

示例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)
 
开发者ID:carriercomm,项目名称:cyclops-web,代码行数:32,代码来源:admin_custom.py


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