Esempio n. 1
0
    def update_config(self, config):
        """
        Add configuration we need during startup
        """
        p.toolkit.add_template_directory(config, "templates")
        p.toolkit.add_public_directory(config, 'public')

        config.update({
            # TODO: We can probably just make this dynamic? Are there
            #       schemas that should *not* be imported other than presets?
            'scheming.dataset_schemas': '\n'.join([
                'ckanext.stcndm:schemas/article.yaml',
                'ckanext.stcndm:schemas/chart.yaml',
                'ckanext.stcndm:schemas/codeset.yaml',
                'ckanext.stcndm:schemas/conference.yaml',
                'ckanext.stcndm:schemas/correction.yaml',
                'ckanext.stcndm:schemas/cube.yaml',
                'ckanext.stcndm:schemas/daily.yaml',
                'ckanext.stcndm:schemas/dataset.yaml',
                'ckanext.stcndm:schemas/format.yaml',
                'ckanext.stcndm:schemas/generic.yaml',
                'ckanext.stcndm:schemas/geodescriptor.yaml',
                'ckanext.stcndm:schemas/indicator.yaml',
                'ckanext.stcndm:schemas/issue.yaml',
                'ckanext.stcndm:schemas/keyword.yaml',
                'ckanext.stcndm:schemas/map.yaml',
                'ckanext.stcndm:schemas/province.yaml',
                'ckanext.stcndm:schemas/publication.yaml',
                'ckanext.stcndm:schemas/pumf.yaml',
                'ckanext.stcndm:schemas/service.yaml',
                'ckanext.stcndm:schemas/subject.yaml',
                'ckanext.stcndm:schemas/survey.yaml',
                'ckanext.stcndm:schemas/video.yaml',
                'ckanext.stcndm:schemas/view.yaml'
            ]),
            'scheming.presets': '\n'.join([
                'ckanext.scheming:presets.json',
                'ckanext.repeating:presets.json',
                'ckanext.fluent:presets.json',
                'ckanext.stcndm:schemas/presets.yaml'
            ]),
            'ckan.search.show_all_types': 'true',
            'search.query_fields': 'product_id_new^8 name^4 '
                                   'title_{{LANG}}^4 text',
            'search.tie': '0.0',
            'search.sort': 'score desc, product_id_new_sort asc',
        })

        from ckanext.stcndm.model.geo import setup
        setup()
Esempio n. 2
0
    def update_config(self, config):
        """
        Add configuration we need during startup
        """
        p.toolkit.add_template_directory(config, "templates")
        p.toolkit.add_public_directory(config, 'public')

        config.update({
            # TODO: We can probably just make this dynamic? Are there
            #       schemas that should *not* be imported other than presets?
            'scheming.dataset_schemas': '\n'.join([
                'ckanext.stcndm:schemas/article.yaml',
                'ckanext.stcndm:schemas/chart.yaml',
                'ckanext.stcndm:schemas/codeset.yaml',
                'ckanext.stcndm:schemas/conference.yaml',
                'ckanext.stcndm:schemas/correction.yaml',
                'ckanext.stcndm:schemas/cube.yaml',
                'ckanext.stcndm:schemas/daily.yaml',
                'ckanext.stcndm:schemas/dataset.yaml',
                'ckanext.stcndm:schemas/format.yaml',
                'ckanext.stcndm:schemas/generic.yaml',
                'ckanext.stcndm:schemas/geodescriptor.yaml',
                'ckanext.stcndm:schemas/indicator.yaml',
                'ckanext.stcndm:schemas/province.yaml',
                'ckanext.stcndm:schemas/publication.yaml',
                'ckanext.stcndm:schemas/pumf.yaml',
                'ckanext.stcndm:schemas/service.yaml',
                'ckanext.stcndm:schemas/subject.yaml',
                'ckanext.stcndm:schemas/survey.yaml',
                'ckanext.stcndm:schemas/video.yaml',
                'ckanext.stcndm:schemas/view.yaml'
            ]),
            'scheming.presets': '\n'.join([
                'ckanext.scheming:presets.json',
                'ckanext.repeating:presets.json',
                'ckanext.fluent:presets.json',
                'ckanext.stcndm:schemas/presets.yaml'
            ])
        })

        from ckanext.stcndm.model.geo import setup
        setup()