Exemplo n.º 1
0
    def update_config(self, config_):
        toolkit.add_template_directory(config_, 'templates')
        toolkit.add_public_directory(config_, 'public')
        toolkit.add_resource('fanstatic', 'knowledgehub')

        # Eliminates the need to re-initialize the database when model changes.
        #        _init_knowledgehub_database()
        _patch_ckan_base_controller()

        # patch the CKAN core functionality
        patch_ckan_core_search()
        # Extend CKAN Tag table
        # extend_tag_table()
        # Extend CKAN ResourceView table
        # extend_resource_view_table()
        # Upgrade the dashboard table.
        #dashboard_table_upgrade()

        DatastoreBackend.register_backends()
        # DatastoreBackend.set_active_backend(config)

        # Create the HDX configuration
        hdx_api_key = config.get(u'ckanext.knowledgehub.hdx.api_key')
        hdx_site = config.get(u'ckanext.knowledgehub.hdx.site', 'test')
        Configuration.delete()
        Configuration.create(
            hdx_site=hdx_site,  # from config, default to test
            user_agent='admin',
            hdx_key=hdx_api_key)
Exemplo n.º 2
0
    def update_config(self, config):
        DatastoreBackend.register_backends()
        DatastoreBackend.set_active_backend(config)

        templates_base = config.get_value('ckan.base_templates_folder')

        p.toolkit.add_template_directory(config, templates_base)
        self.backend = DatastoreBackend.get_active_backend()
Exemplo n.º 3
0
    def update_config(self, config):
        DatastoreBackend.register_backends()
        DatastoreBackend.set_active_backend(config)

        templates_base = config.get('ckan.base_templates_folder')

        p.toolkit.add_template_directory(config, templates_base)
        self.backend = DatastoreBackend.get_active_backend()
Exemplo n.º 4
0
    def update_config(self, config):
        DatastoreBackend.register_backends()
        DatastoreBackend.set_active_backend(config)

        p.toolkit.add_template_directory(config, 'templates')
        self.backend = DatastoreBackend.get_active_backend()
Exemplo n.º 5
0
 def test_backends_correctly_registered(self):
     DatastoreBackend.register_backends()
     assert u"sqlite" in DatastoreBackend._backends
     assert u"postgresql" in DatastoreBackend._backends
Exemplo n.º 6
0
 def test_backends_correctly_registered(self):
     DatastoreBackend.register_backends()
     assert_in(u'sqlite', DatastoreBackend._backends)
     assert_in(u'postgresql', DatastoreBackend._backends)
Exemplo n.º 7
0
 def test_backends_correctly_registered(self):
     DatastoreBackend.register_backends()
     assert_in(u'sqlite', DatastoreBackend._backends)
     assert_in(u'postgresql', DatastoreBackend._backends)
 def test_backends_correctly_registered(self):
     DatastoreBackend.register_backends()
     assert u"bigquery" in DatastoreBackend._backends
     assert u"postgres" in DatastoreBackend._backends