本文整理汇总了Python中evoque.domain.Domain.set_collection方法的典型用法代码示例。如果您正苦于以下问题:Python Domain.set_collection方法的具体用法?Python Domain.set_collection怎么用?Python Domain.set_collection使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类evoque.domain.Domain
的用法示例。
在下文中一共展示了Domain.set_collection方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: Domain
# 需要导入模块: from evoque.domain import Domain [as 别名]
# 或者: from evoque.domain.Domain import set_collection [as 别名]
# create template domain instance
# here restating all defaults, for doc convenience
domain = Domain(DEFAULT_DIR,
restricted=False, errors=3, log=logging.getLogger("evoque"),
cache_size=0, auto_reload=60, slurpy_directives=True,
quoting="xml", input_encoding="utf-8", filters=[] )
# adjust global namespace as needed by application
domain.set_on_globals("ObjectPaginator", ObjectPaginator)
domain.set_on_globals("site_name", "mysite.net")
domain.set_namespace_on_globals("formatting_utils", formatting_utils)
# set up any other collection, as needed by application
# here restating all defaults -- when None, domain's value is used
domain.set_collection("custom", "/home/me/custom_collection/",
cache_size=None, auto_reload=None, slurpy_directives=None,
quoting=None, input_encoding=None, filters=None)
# here we would do any other domain setup we might need
# e.g. set a template default for a given collection
# for details see: http://evoque.gizmojo.org/usage/
# or the source of the evoque.domain module.
def evoque_django_response(request, name,
src=None, collection=None, raw=None, data=None,
quoting=None, input_encoding=None, filters=None,
**kwargs):
""" Render an evoque template to a django response object
"""