本文整理汇总了Python中ckan.plugins.toolkit.add_template_directory方法的典型用法代码示例。如果您正苦于以下问题:Python toolkit.add_template_directory方法的具体用法?Python toolkit.add_template_directory怎么用?Python toolkit.add_template_directory使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ckan.plugins.toolkit
的用法示例。
在下文中一共展示了toolkit.add_template_directory方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: update_config
# 需要导入模块: from ckan.plugins import toolkit [as 别名]
# 或者: from ckan.plugins.toolkit import add_template_directory [as 别名]
def update_config(self, config):
# Add this plugin's templates dir to CKAN's extra_template_paths, so
# that CKAN will use this plugin's custom templates.
if p.toolkit.check_ckan_version(min_version='2.8'):
tk.add_template_directory(config, 'templates_2.8')
else:
tk.add_template_directory(config, 'templates')
# Register this plugin's fanstatic directory with CKAN.
tk.add_resource(b'fanstatic', b'privatedatasets')
######################################################################
############################# IBLUEPRINT #############################
######################################################################
# Deprecated but Required for CKAN 2.7
示例2: update_config
# 需要导入模块: from ckan.plugins import toolkit [as 别名]
# 或者: from ckan.plugins.toolkit import add_template_directory [as 别名]
def update_config(self, config_):
toolkit.add_template_directory(config_, 'templates')
toolkit.add_public_directory(config_, 'public')
toolkit.add_resource('fanstatic', 'discourse')
示例3: update_config
# 需要导入模块: from ckan.plugins import toolkit [as 别名]
# 或者: from ckan.plugins.toolkit import add_template_directory [as 别名]
def update_config(self, config_):
tk.add_template_directory(config_, 'templates')
# IGroupForm
示例4: update_config
# 需要导入模块: from ckan.plugins import toolkit [as 别名]
# 或者: from ckan.plugins.toolkit import add_template_directory [as 别名]
def update_config(self, config):
# Add this plugin's templates dir to CKAN's extra_template_paths, so
# that CKAN will use this plugin's custom templates.
tk.add_template_directory(config, 'templates')
示例5: update_config
# 需要导入模块: from ckan.plugins import toolkit [as 别名]
# 或者: from ckan.plugins.toolkit import add_template_directory [as 别名]
def update_config(self, config):
toolkit.add_template_directory(config, 'templates')
示例6: update_config
# 需要导入模块: from ckan.plugins import toolkit [as 别名]
# 或者: from ckan.plugins.toolkit import add_template_directory [as 别名]
def update_config(self, config):
toolkit.add_template_directory(config, 'templates')
toolkit.add_resource('fanstatic', 'example_theme')
示例7: update_config
# 需要导入模块: from ckan.plugins import toolkit [as 别名]
# 或者: from ckan.plugins.toolkit import add_template_directory [as 别名]
def update_config(self, config):
# Add this plugin's templates dir to CKAN's extra_template_paths, so
# that CKAN will use this plugin's custom templates.
toolkit.add_template_directory(config, 'templates')
示例8: update_config
# 需要导入模块: from ckan.plugins import toolkit [as 别名]
# 或者: from ckan.plugins.toolkit import add_template_directory [as 别名]
def update_config(self, config):
# Add this plugin's templates dir to CKAN's extra_template_paths, so
# that CKAN will use this plugin's custom templates.
# 'templates' is the path to the templates dir, relative to this
# plugin.py file.
toolkit.add_template_directory(config, 'templates')
示例9: update_config
# 需要导入模块: from ckan.plugins import toolkit [as 别名]
# 或者: from ckan.plugins.toolkit import add_template_directory [as 别名]
def update_config(self, config):
# Add this plugin's templates dir to CKAN's extra_template_paths, so
# that CKAN will use this plugin's custom templates.
toolkit.add_template_directory(config, 'templates')
# Add this plugin's public dir to CKAN's extra_public_paths, so
# that CKAN will use this plugin's custom static files.
toolkit.add_public_directory(config, 'public')
示例10: update_config
# 需要导入模块: from ckan.plugins import toolkit [as 别名]
# 或者: from ckan.plugins.toolkit import add_template_directory [as 别名]
def update_config(self, config):
# Add extension templates directory
toolkit.add_template_directory(config, 'templates')
# Add a new ckan-admin tabs for our extension
toolkit.add_ckan_admin_tab(config, 'ckanext_myext_config_one',
'My First Custom Config Tab')
toolkit.add_ckan_admin_tab(config, 'ckanext_myext_config_two',
'My Second Custom Config Tab')
示例11: update_config
# 需要导入模块: from ckan.plugins import toolkit [as 别名]
# 或者: from ckan.plugins.toolkit import add_template_directory [as 别名]
def update_config(self, config):
# Add extension templates directory
toolkit.add_template_directory(config, 'templates')