Security News
Weekly Downloads Now Available in npm Package Search Results
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
django-daterange-filter
Advanced tools
.. image:: https://travis-ci.org/tzulberti/django-datefilterspec.svg?branch=master :alt: Build status :target: https://travis-ci.org/tzulberti/django-datefilterspec
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.
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.
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
.
1.3.0:
1.1.1:
0.2.0:
0.1.1:
FAQs
Allow to filter by a custom date range on the Django Admin
We found that django-daterange-filter demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
Security News
A Stanford study reveals 9.5% of engineers contribute almost nothing, costing tech $90B annually, with remote work fueling the rise of "ghost engineers."
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.