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:
- Fetch the dataset via
package_show(standard CKAN behavior) - Slice the resources list to 50 items based on the
resource_pageURL parameter - Only call
resource_view_liston the visible 50 resources (not all of them) - 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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file ckanext_resource_pagination-0.1.1.tar.gz.
File metadata
- Download URL: ckanext_resource_pagination-0.1.1.tar.gz
- Upload date:
- Size: 4.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1f1cfc58d668d1219799d31887903470cf2aa15d09fede09fc791f780cfdbac7
|
|
| MD5 |
633d4552a83ce1cdb721e7d36a2be155
|
|
| BLAKE2b-256 |
9e39810809504f61cb29f0bf3db6d6e99b28e783ae48b2dcd13e21d75f8e2617
|
File details
Details for the file ckanext_resource_pagination-0.1.1-py3-none-any.whl.
File metadata
- Download URL: ckanext_resource_pagination-0.1.1-py3-none-any.whl
- Upload date:
- Size: 6.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b7c7cd285d2aaeb957142c04b6044a60b6ffbf7f1a4f3a0bf26a85f2c3eeb8c4
|
|
| MD5 |
58179aa073dcc9162d948d259d26a4d2
|
|
| BLAKE2b-256 |
a35dce9515679e154fb478f6a257c16905f8f93990eb230833f0c2f77999c34b
|