本文整理匯總了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')