Skip to content

Plugin

StatisticsPlugin ΒΆ

Bases: SingletonPlugin

NHM Statistics.

Source code in ckanext/statistics/plugin.py
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
class StatisticsPlugin(SingletonPlugin):
    """
    NHM Statistics.
    """

    implements(interfaces.IActions)
    implements(interfaces.IConfigurable)

    # IActions
    @staticmethod
    def get_actions():
        return {
            'download_statistics': download_statistics,
            'dataset_statistics': dataset_statistics,
        }

    # IConfigurable
    def configure(self, config):
        # configure cache
        options = {}
        for k, v in config.items():
            if k.startswith('ckanext.statistics.cache.'):
                options[k.split('.')[-1]] = v
        cache_regions.update({'ckanext_statistics': options})