Skip to main content

Paginate resources on CKAN dataset pages

Project description

ckanext-resource-pagination

Paginate resources on CKAN dataset pages. Prevents browser crashes on datasets with thousands of resources by showing 50 per page with navigation controls.

Requirements

  • CKAN 2.11+
  • Python 3.8+

Installation

pip install ckanext-resource-pagination

Or from source:

pip install -e git+https://github.com/tanmayagrawal21/ckanext-resource-pagination.git#egg=ckanext-resource-pagination

Configuration

Add resource_pagination to ckan.plugins in your ckan.ini:

ckan.plugins = ... resource_pagination

No other configuration needed.

How it works

The plugin overrides the dataset read view (/dataset/<id>) to:

  1. Fetch the dataset via package_show (standard CKAN behavior)
  2. Slice the resources list to 50 items based on the resource_page URL parameter
  3. Only call resource_view_list on the visible 50 resources (not all of them)
  4. Pass pagination metadata to the template for rendering page controls

This means a dataset with 11,000 resources loads as fast as one with 20.

License

AGPL-3.0

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ckanext_resource_pagination-0.2.0.tar.gz (5.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ckanext_resource_pagination-0.2.0-py3-none-any.whl (6.7 kB view details)

Uploaded Python 3

File details

Details for the file ckanext_resource_pagination-0.2.0.tar.gz.

File metadata

File hashes

Hashes for ckanext_resource_pagination-0.2.0.tar.gz
Algorithm Hash digest
SHA256 1e31a7540428c44310baff31af6ddfa69768e37fe3862e860c97c7dd49ef5cee
MD5 3eabf37aa2717aefa78619c9bd0cb4b9
BLAKE2b-256 36b0271cb1d055d1d314e0f3596aeead333f2578eee2087d6e44b96b45310dc7

See more details on using hashes here.

File details

Details for the file ckanext_resource_pagination-0.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for ckanext_resource_pagination-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 175c1a9097b9ec2517674e13a54b8853dcd9d88585b8793d18af06456d7e6249
MD5 50fbb570e0230509a1ceac5ca4018b16
BLAKE2b-256 933a1ebdb17d61f406c0391b7e1f141ddca13c82af2d82ed1d4dd5195fcd419d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page