Reusable Django app containing utilities for DDH projects
Project description
Provides a number of useful utilities for Django projects, particularly within the context of DDH projects.
Pagination
ddh_utils.utils provides the create_pagination function to generate Paginator and Page objects from the supplied parameters, handling any problems with the supplied page number. This just avoids repeating the example view code from the Django documentation.
The ddh_utils_tags template tag library provides the display_pagination inclusion tag, which outputs the navigation for a set of results, based on the supplied page:
{% load ddh_utils_tags %} {% display_pagination querydict page %}
This includes the template includes/pagination.html.
Haystack
ddh_utils.views provides SearchView and FacetedSearchView classes that have better pagination than those in Haystack’s own views (making use of the create_pagination function), and also add the request’s GET parameters to the context for use in pagination and facetting.
ddh_util_tags provides simple tags for creating URLs by adding and removing facets:
{% load ddh_utils_tags %} <a href="{% add_facet_link querydict name value %}">Add</a> <a href="{% remove_facet_link querydict "name:value" %}">Remove</a>
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
File details
Details for the file ddh_django_utils-0.9.2.tar.gz
.
File metadata
- Download URL: ddh_django_utils-0.9.2.tar.gz
- Upload date:
- Size: 4.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b076fd0b4e72a23e60f600b98205e51a857bf05547bba8b881a425314622d5c6 |
|
MD5 | 74289699c0b2b8f0930d1def159ac165 |
|
BLAKE2b-256 | 0722b4288495e372dbf5a5c952463f4767daded401a09a6cdc9f28e512e0e90e |
File details
Details for the file ddh_django_utils-0.9.2-py2-none-any.whl
.
File metadata
- Download URL: ddh_django_utils-0.9.2-py2-none-any.whl
- Upload date:
- Size: 6.3 kB
- Tags: Python 2
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 51dae3e4e5ac01d826071fc32034f22d9a1e17877f18e55a8aa7a580e510ee24 |
|
MD5 | 468be4f5b0158b37ff21b41474c9279f |
|
BLAKE2b-256 | 763ade641025a73039e4e20311d72c087b5cc8c638daf399b9b28cdbb77a6e8d |