當前位置: 首頁>>代碼示例>>Python>>正文


Python toolkit.add_public_directory方法代碼示例

本文整理匯總了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') 
開發者ID:italia,項目名稱:daf-recipes,代碼行數:18,代碼來源:plugin.py

示例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') 
開發者ID:OpenGov-OpenData,項目名稱:ckanext-discourse,代碼行數:6,代碼來源:plugin.py

示例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') 
開發者ID:italia,項目名稱:daf-recipes,代碼行數:11,代碼來源:plugin.py

示例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') 
開發者ID:italia,項目名稱:daf-recipes,代碼行數:10,代碼來源:plugin.py

示例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 ---------------# 
開發者ID:italia,項目名稱:daf-recipes,代碼行數:8,代碼來源:plugin.py

示例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 ###############################
    ###################################################################### 
開發者ID:conwetlab,項目名稱:ckanext-datarequests,代碼行數:16,代碼來源:plugin.py

示例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 
開發者ID:ckan,項目名稱:ckanext-showcase,代碼行數:11,代碼來源:plugin.py

示例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
    # 
開發者ID:stadt-karlsruhe,項目名稱:ckanext-extractor,代碼行數:10,代碼來源:plugin.py

示例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') 
開發者ID:jqnatividad,項目名稱:ckanext-officedocs,代碼行數:6,代碼來源:plugin.py


注:本文中的ckan.plugins.toolkit.add_public_directory方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。