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


Python Context.__init__方法代码示例

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


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

示例1: __init__

# 需要导入模块: from django.template.context import Context [as 别名]
# 或者: from django.template.context.Context import __init__ [as 别名]
 def __init__(self, dict, instance, placeholder, processors=None, current_app=None):
     Context.__init__(self, dict, current_app=current_app)
     if processors is None:
         processors = ()
     else:
         processors = tuple(processors)
     for processor in DEFAULT_PLUGIN_CONTEXT_PROCESSORS + get_standard_processors('CMS_PLUGIN_CONTEXT_PROCESSORS') + processors:
         self.update(processor(instance, placeholder))
开发者ID:anhtuanvan,项目名称:django-cms-2.0,代码行数:10,代码来源:plugin_rendering.py

示例2: __init__

# 需要导入模块: from django.template.context import Context [as 别名]
# 或者: from django.template.context.Context import __init__ [as 别名]
 def __init__(self, dict=None, processors=None, current_app=None):
     Context.__init__(self, dict, current_app=current_app)
     if processors is None:
         processors = ()
     else:
         processors = tuple(processors)
     for processor in (
         tuple(p for p in get_standard_processors() if getattr(p, "requires_request", True) == False) + processors
     ):
         self.update(processor())
开发者ID:pombredanne,项目名称:turkey,代码行数:12,代码来源:template.py

示例3: __init__

# 需要导入模块: from django.template.context import Context [as 别名]
# 或者: from django.template.context.Context import __init__ [as 别名]
    def __init__(self, request, dict=None, current_app=None):
        # If there is any reason to site-global context processors for plugins,
        # I'd like to know the usecase, and it could be implemented here.
        if current_app is None:
            # Avoid RemovedInDjango110Warning
            Context.__init__(self, dict)
        else:
            Context.__init__(self, dict, current_app=current_app)

        for processor in _STANDARD_REQUEST_CONTEXT_PROCESSORS:
            self.update(processor(request))
开发者ID:django-fluent,项目名称:django-fluent-contents,代码行数:13,代码来源:pluginbase.py

示例4: __init__

# 需要导入模块: from django.template.context import Context [as 别名]
# 或者: from django.template.context.Context import __init__ [as 别名]
    def __init__(self, request, dict=None, processors=None, current_app=None, use_l10n=None):
        if not dict:
            dict = {}

        # 基础配置信息
        configuration = Configuration.objects.filter()

        if configuration:
            dict['configuration'] = configuration[0]

        # ‘公共’尾部信息
        foot_items = FootItem.objects.filter(is_display=True).order_by('order')
        if foot_items:
            dict['foot_items'] = foot_items
            
        Context.__init__(self, dict, current_app=current_app, use_l10n=use_l10n)
        if processors is None:
            processors = ()
        else:
            processors = tuple(processors)
        for processor in get_standard_processors() + processors:
            self.update(processor(request))
开发者ID:leonzhou,项目名称:wjzpw-web,代码行数:24,代码来源:component.py


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