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