Skip to main content

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 (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>

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

ddh_django_utils-0.9.4.tar.gz (8.7 kB view details)

Uploaded Source

Built Distribution

ddh_django_utils-0.9.4-py2-none-any.whl (14.0 kB view details)

Uploaded Python 2

File details

Details for the file ddh_django_utils-0.9.4.tar.gz.

File metadata

File hashes

Hashes for ddh_django_utils-0.9.4.tar.gz
Algorithm Hash digest
SHA256 13db503021bd87ac7171572b04fc9694129be9be3a3eae1db8d6ee1019dc8c13
MD5 4ebf0710a80a74456e84d107d6f37aed
BLAKE2b-256 f240913a5c682cd1752f5dc696bce728a8a407a929ab9488a3e06b53042b289c

See more details on using hashes here.

File details

Details for the file ddh_django_utils-0.9.4-py2-none-any.whl.

File metadata

File hashes

Hashes for ddh_django_utils-0.9.4-py2-none-any.whl
Algorithm Hash digest
SHA256 8d96da070277599277ed08529197857a0b768a16866df5af5f367d99cd22286b
MD5 3602e7a6c6833f16aa5d7bdb624a56f3
BLAKE2b-256 f9e43bc27437feeac19837ce88e9e67202291bcb93bad92cdcbdc16bfa0ab9fa

See more details on using hashes here.

Supported by

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