• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

qld-gov-au / ckan / ffdd3d13-9fd2-42d6-8817-f9a076d0bad6

21 Jan 2026 02:47AM UTC coverage: 79.551% (-8.3%) from 87.869%
ffdd3d13-9fd2-42d6-8817-f9a076d0bad6

Pull #239

circleci

ThrawnCA
[QOLSVC-12515] add support for specifying facet sorts via query parameters

- Use '_{facet}_sort' as a parallel to '_{facet}_limit', with comma separation for the ordering, eg
'_tags_sort=count,desc' to mimic the default popularity-based sorting.
Pull Request #239: QOLSVC-12515 alphabetical facet sort

11 of 35 new or added lines in 2 files covered. (31.43%)

13656 existing lines in 309 files now uncovered.

42766 of 53759 relevant lines covered (79.55%)

1.63 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

100.0
/ckanext/example_theme_docs/v15_webassets/plugin.py
1
# encoding: utf-8
2

UNCOV
3
from ckan.common import CKANConfig
1✔
UNCOV
4
import ckan.plugins as plugins
1✔
UNCOV
5
import ckan.plugins.toolkit as toolkit
1✔
6

7

UNCOV
8
def most_popular_groups():
1✔
9
    '''Return a sorted list of the groups with the most datasets.'''
10

11
    # Get a list of all the site's groups from CKAN, sorted by number of
12
    # datasets.
UNCOV
13
    groups = toolkit.get_action('group_list')(
1✔
14
        {}, {'sort': 'package_count desc', 'all_fields': True})
15

16
    # Truncate the list to the 10 most popular groups only.
UNCOV
17
    groups = groups[:10]
1✔
18

UNCOV
19
    return groups
1✔
20

21

UNCOV
22
class ExampleThemePlugin(plugins.SingletonPlugin):
1✔
23
    '''An example theme plugin.
24

25
    '''
UNCOV
26
    plugins.implements(plugins.IConfigurer)
1✔
27

28
    # Declare that this plugin will implement ITemplateHelpers.
UNCOV
29
    plugins.implements(plugins.ITemplateHelpers)
1✔
30

UNCOV
31
    def update_config(self, config: CKANConfig):
1✔
32

33
        # Add this plugin's templates dir to CKAN's extra_template_paths, so
34
        # that CKAN will use this plugin's custom templates.
UNCOV
35
        toolkit.add_template_directory(config, 'templates')
1✔
36

37
        # Add this plugin's public dir to CKAN's extra_public_paths, so
38
        # that CKAN will use this plugin's custom static files.
UNCOV
39
        toolkit.add_public_directory(config, 'public')
1✔
40

41
        # Register this plugin's assets directory with CKAN.
42
        # Here, 'assets' is the path to the webassets directory
43
        # (relative to this plugin.py file), and 'example_theme' is the name
44
        # that we'll use to refer to this assets directory from CKAN
45
        # templates.
UNCOV
46
        toolkit.add_resource('assets', 'example_theme')
1✔
47

UNCOV
48
    def get_helpers(self):
1✔
49
        '''Register the most_popular_groups() function above as a template
50
        helper function.
51

52
        '''
53
        # Template helper function names should begin with the name of the
54
        # extension they belong to, to avoid clashing with functions from
55
        # other extensions.
UNCOV
56
        return {'example_theme_most_popular_groups': most_popular_groups}
1✔
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc