Skip to main content

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 (under the variable name querydict) 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>

Metadata

Release files for ddh_django_utils 0.9.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ddh_django_utils 0.9.4
File Size Uploaded
ddh_django_utils-0.9.4.tar.gz 8.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for ddh_django_utils 0.9.4
File Interpreter ABI Platform
ddh_django_utils-0.9.4-py2-none-any.whl Python 2 none any Details

Total release size: 22.7 kB

Release files / ddh_django_utils-0.9.4.tar.gz

Download URL ddh_django_utils-0.9.4.tar.gz
Size 8.7 kB
Tags Source
SHA-256 checksum
How to use checksums
13db503021bd87ac7171572b04fc9694129be9be3a3eae1db8d6ee1019dc8c13
BLAKE2b-256 checksum
How to use checksums
f240913a5c682cd1752f5dc696bce728a8a407a929ab9488a3e06b53042b289c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / ddh_django_utils-0.9.4-py2-none-any.whl

Download URL ddh_django_utils-0.9.4-py2-none-any.whl
Size 14.0 kB
Tags Python 2
SHA-256 checksum
How to use checksums
8d96da070277599277ed08529197857a0b768a16866df5af5f367d99cd22286b
BLAKE2b-256 checksum
How to use checksums
f9e43bc27437feeac19837ce88e9e67202291bcb93bad92cdcbdc16bfa0ab9fa
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

0.9.4 This release

2 release files

0.9.3

2 release files

0.9.2

2 release files

0.9.1

2 release files

0.9

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page