Skip to main content
.. image:: https://travis-ci.org/tzulberti/django-datefilterspec.svg?branch=master
:alt: Build status
:target: https://travis-ci.org/tzulberti/django-datefilterspec

django-daterange-filter
=======================

Add the option to filter by a custom date range on the admin. This allows
to inputs to be used to get the custom date range filters.

See datefilter.png of a screenshot of how this is seen on the admin.

**IMPORTANT:** this will work with Django 1.4. I won't work with previous Django
versions.

Installation
------------

Use pip/easy_install

.. code-block:: bash

pip install django-daterange-filter


Add daterange_filter to settings.INSTALLED_APP. For this, edit the setup.py
file:

.. code-block:: python

INSTALLED_APPS = (
...
'daterange_filter'
)

After this, if you have a model like this one:

.. code-block:: python

class MyModel(models.Model):
...
foo = models.CharField(max_length=1, choices=BAR_CHOICES)
created_at = models.DateField()


To allow to filter the **created_at** field using the date ranges, you must
edit the admin.ModelAdmin referenced to that class:

.. code-block:: python

from daterange_filter.filter import DateRangeFilter
from django.contrib import admin
from models import MyModel

class MyModelAdmin(admin.ModelAdmin):
list_filter = (
'foo',
('created', DateRangeFilter), # this is a tuple
...
)


DateRangeFilter honours localization and supports local date
formats for filtering.

Running tests
-------
First :code:`pip install -r requirements.txt`, then :code:`python ./runtests.py`

If you wanna run tests on all supported Python/Django versions, execute :code:`tox`.

Changes
-------

1.3.0:

* Fixed calendar icon moving to a new line in Django 1.9 (Special thanks to https://github.com/farooqaaa)
* fix daterange_filter function (Special thanks to https://github.com/ZamorakLin)

1.1.1:

* Special thanks to: https://github.com/mightygraf

0.2.0:

* Updated README
* Works with DateTime (special thanks to Andrea Rabbaglietti)

0.1.1:

* Removed the custom DateRangeField
* Improved i18n
* Special thanks to: https://github.com/DXist

Release files for django-daterange-filter 1.3.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-daterange-filter 1.3.0
File Size Uploaded
django-daterange-filter-1.3.0.tar.gz 5.1 kB Details

Release files / django-daterange-filter-1.3.0.tar.gz

Download URL django-daterange-filter-1.3.0.tar.gz
Size 5.1 kB
Tags Source
SHA-256 checksum
How to use checksums
f31aee8f747f36b3a25fa332ad5c3e170e87ba97e957aacfa196c1cd68ac336e
BLAKE2b-256 checksum
How to use checksums
c53d7756a4583faf71d4a5d2a3f71290095d61b9b8cbebb2ae9dcef4f4405909
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

1.3.0 This release

1 release file

1.2.0

1 release file

1.1.1

1 release file

1.1.0

1 release file

1.0.0

1 release file

0.2.1

1 release file

0.2.0

1 release file

0.1.1

1 release file

0.0.2

1 release file

0.0.1

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