本文整理汇总了Python中ckan.plugins.toolkit.add_resource方法的典型用法代码示例。如果您正苦于以下问题:Python toolkit.add_resource方法的具体用法?Python toolkit.add_resource怎么用?Python toolkit.add_resource使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ckan.plugins.toolkit
的用法示例。
在下文中一共展示了toolkit.add_resource方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: update_config
# 需要导入模块: from ckan.plugins import toolkit [as 别名]
# 或者: from ckan.plugins.toolkit import add_resource [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')
# Register this plugin's fanstatic directory with CKAN.
# Here, 'fanstatic' is the path to the fanstatic directory
# (relative to this plugin.py file), and 'example_theme' is the name
# that we'll use to refer to this fanstatic directory from CKAN
# templates.
toolkit.add_resource('fanstatic', 'example_theme')
示例2: update_config
# 需要导入模块: from ckan.plugins import toolkit [as 别名]
# 或者: from ckan.plugins.toolkit import add_resource [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
示例3: update_config
# 需要导入模块: from ckan.plugins import toolkit [as 别名]
# 或者: from ckan.plugins.toolkit import add_resource [as 别名]
def update_config(self, config_):
toolkit.add_template_directory(config_, 'templates')
toolkit.add_public_directory(config_, 'public')
toolkit.add_resource('fanstatic', 'discourse')
示例4: update_config
# 需要导入模块: from ckan.plugins import toolkit [as 别名]
# 或者: from ckan.plugins.toolkit import add_resource [as 别名]
def update_config(self, config):
toolkit.add_template_directory(config, 'templates')
toolkit.add_resource('fanstatic', 'example_theme')
示例5: update_config
# 需要导入模块: from ckan.plugins import toolkit [as 别名]
# 或者: from ckan.plugins.toolkit import add_resource [as 别名]
def update_config(self, config):
'''
Set up the resource library, public directory and
template directory for the view
'''
toolkit.add_public_directory(config, 'theme/public')
toolkit.add_template_directory(config, 'theme/templates')
toolkit.add_resource('theme/public', 'ckanext-reclineview')
示例6: update_config
# 需要导入模块: from ckan.plugins import toolkit [as 别名]
# 或者: from ckan.plugins.toolkit import add_resource [as 别名]
def update_config(self, config_):
toolkit.add_template_directory(config_, 'templates')
toolkit.add_public_directory(config_, 'public')
toolkit.add_resource('fanstatic', 'multilang')
# see the ITemplateHelpers plugin interface.
示例7: update_config
# 需要导入模块: from ckan.plugins import toolkit [as 别名]
# 或者: from ckan.plugins.toolkit import add_resource [as 别名]
def update_config(self, config_):
toolkit.add_template_directory(config_, 'templates')
toolkit.add_public_directory(config_, 'public')
toolkit.add_resource('fanstatic', 'ckanext-dcatapit')
# ------------- IDatasetForm ---------------#
示例8: update_config
# 需要导入模块: from ckan.plugins import toolkit [as 别名]
# 或者: from ckan.plugins.toolkit import add_resource [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')
# Register this plugin's fanstatic directory with CKAN.
tk.add_public_directory(config, 'public')
# Register this plugin's fanstatic directory with CKAN.
tk.add_resource('fanstatic', 'datarequest')
######################################################################
############################## IROUTES ###############################
######################################################################
示例9: update_config
# 需要导入模块: from ckan.plugins import toolkit [as 别名]
# 或者: from ckan.plugins.toolkit import add_resource [as 别名]
def update_config(self, config):
tk.add_template_directory(config, 'templates')
tk.add_public_directory(config, 'public')
tk.add_resource('fanstatic', 'showcase')
if tk.check_ckan_version(min_version='2.4'):
tk.add_ckan_admin_tab(config, 'ckanext_showcase_admins',
'Showcase Config')
# IConfigurable
示例10: update_config
# 需要导入模块: from ckan.plugins import toolkit [as 别名]
# 或者: from ckan.plugins.toolkit import add_resource [as 别名]
def update_config(self, config):
toolkit.add_template_directory(config, 'templates')
toolkit.add_public_directory(config, 'public')
toolkit.add_resource('fanstatic', 'extractor')
#
# IConfigurable
#
示例11: update_config
# 需要导入模块: from ckan.plugins import toolkit [as 别名]
# 或者: from ckan.plugins.toolkit import add_resource [as 别名]
def update_config(self, config_):
toolkit.add_template_directory(config_, 'templates')
toolkit.add_public_directory(config_, 'public')
toolkit.add_resource('fanstatic', 'officedocs')