Skip to main content

Django admin date range filter

Build Status GitHub release PyPI release Python version GitHub issues Code quality Coverage GitHub license

Application adds three Django admin list filters: DateRangeFilter, PastDateRangeFilter and FutureDateRangeFilter. These filters let user filter models by date range. PastDateRangeFilter and FutureDateRangeFilter add quick selection of predefined date ranges. Filters can be applied to any model date fields. Application supports default Django admin theme and Suit theme.

Admin screenshot

Requirements

  • Python 2.7+ or Python 3.3+
  • Django 1.9+

Installation

Install django-daterangefilter using pip:

pip install django-daterangefilter

Add daterangefilter to INSTALLED_APPS. Example:

INSTALLED_APPS = (
    ...
    'daterangefilter',
    ...
)

Application uses static files so do not forget to issue collectstatic management command in production environment.

Example usage

in admin.py:

from django.contrib import admin
from daterangefilter.filters import PastDateRangeFilter, FutureDateRangeFilter

@admin.register(Post)
class PostAdmin(admin.ModelAdmin):
    list_filter = [
        ('created_at', PastDateRangeFilter), ('publish_at', FutureDateRangeFilter)
    ]

Advanced usage

Predefined ranges can be completely redefined by overriding _past_ranges.html and _future_ranges.html templates. Take into account that these templates are inserted in the middle of the javascript code and may contain nothing but ranges definition. For more examples on using moment library refer to library documentation.

Credits

Filter widget uses a great JavaScript date range picker component - Date Range Picker by Dan Grossman.

Metadata

Release files for django-daterangefilter-fixed 1.1.0

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

Source distribution (sdist)

Source distribution for django-daterangefilter-fixed 1.1.0
File Size Uploaded Provenance Actions
django-daterangefilter-fixed-1.1.0.tar.gz 107.5 kB Without provenance Details for django-daterangefilter-fixed-1.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for django-daterangefilter-fixed 1.1.0
File Interpreter ABI Platform Actions
django_daterangefilter_fixed-1.1.0-py2.py3-none-any.whl Python 3, Python 2 none any Details for django_daterangefilter_fixed-1.1.0-py2.py3-none-any.whl

Total release size: 218.8 kB

Release files / django-daterangefilter-fixed-1.1.0.tar.gz

Download URL django-daterangefilter-fixed-1.1.0.tar.gz
Size 107.5 kB
Tags Source
SHA-256 checksum
How to use checksums
8350d7e1cc04473c87f4293dc337132ff0e6b2336e59ce66655cbca99aed4ba4
BLAKE2b-256 checksum
How to use checksums
60ce0b67119125bd2a7b3ed0d9fb2dfe80c9e5feb30f0c212df4107637850093
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.3

Release files / django_daterangefilter_fixed-1.1.0-py2.py3-none-any.whl

Download URL django_daterangefilter_fixed-1.1.0-py2.py3-none-any.whl
Size 111.3 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
13b3f71b8661e6a586d531bb36a0db113cccf35c78c8abc54d89fc202e6d949e
BLAKE2b-256 checksum
How to use checksums
c8c06f708d33776a78c48c0157364e0926f2ca6dc00d191c3a304d6d4a9fcbe3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.3

Security for django-daterangefilter-fixed 1.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1.1.0 This release

2 release files No provenance

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