本文整理汇总了Python中ckan.plugins.toolkit.add_public_directory方法的典型用法代码示例。如果您正苦于以下问题:Python toolkit.add_public_directory方法的具体用法?Python toolkit.add_public_directory怎么用?Python toolkit.add_public_directory使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ckan.plugins.toolkit
的用法示例。
在下文中一共展示了toolkit.add_public_directory方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: update_config
# 需要导入模块: from ckan.plugins import toolkit [as 别名]
# 或者: from ckan.plugins.toolkit import add_public_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')
# 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_public_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_public_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')
示例4: update_config
# 需要导入模块: from ckan.plugins import toolkit [as 别名]
# 或者: from ckan.plugins.toolkit import add_public_directory [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')
示例5: update_config
# 需要导入模块: from ckan.plugins import toolkit [as 别名]
# 或者: from ckan.plugins.toolkit import add_public_directory [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 ---------------#
示例6: update_config
# 需要导入模块: from ckan.plugins import toolkit [as 别名]
# 或者: from ckan.plugins.toolkit import add_public_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')
# 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 ###############################
######################################################################
示例7: update_config
# 需要导入模块: from ckan.plugins import toolkit [as 别名]
# 或者: from ckan.plugins.toolkit import add_public_directory [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
示例8: update_config
# 需要导入模块: from ckan.plugins import toolkit [as 别名]
# 或者: from ckan.plugins.toolkit import add_public_directory [as 别名]
def update_config(self, config):
toolkit.add_template_directory(config, 'templates')
toolkit.add_public_directory(config, 'public')
toolkit.add_resource('fanstatic', 'extractor')
#
# IConfigurable
#
示例9: update_config
# 需要导入模块: from ckan.plugins import toolkit [as 别名]
# 或者: from ckan.plugins.toolkit import add_public_directory [as 别名]
def update_config(self, config_):
toolkit.add_template_directory(config_, 'templates')
toolkit.add_public_directory(config_, 'public')
toolkit.add_resource('fanstatic', 'officedocs')