Debian packaging for django-admin-rangefilter
Go to file
Frédéric Péters 60cf4342ea bump version number 2022-08-05 22:28:22 +02:00
.github/workflows Add GitHub Action 2019-12-04 13:17:53 +03:00
debian debian: disable tests using PYBUILD_DISABLE=test 2022-08-05 22:24:04 +02:00
docs/images Init commit 2016-06-24 13:17:49 +03:00
rangefilter bump version number 2022-08-05 22:28:22 +02:00
.gitignore Updated translation 2019-01-31 12:42:21 +03:00
.travis.yml Compatibility Django 3.0 2019-12-04 11:55:54 +03:00
CHANGELOG.md Prepare 0.5.4 2020-02-10 13:04:20 +03:00
CONTRIBUTING.md Create CONTRIBUTING.md 2020-01-27 16:29:54 +03:00
LICENSE Init commit 2016-06-24 13:17:49 +03:00
MANIFEST.in Update MANIFEST 2019-12-04 13:23:08 +03:00
Makefile Update makefile now clean __pycache__ 2019-06-21 14:10:17 +03:00
README.rst Fix README 2019-07-04 09:45:51 +03:00
runtests.py Compatibility Django 2.1 2019-04-05 14:16:13 +03:00
setup.py Fix problem when thousand separator is used (#18) 2019-05-14 13:07:00 +03:00

README.rst

.. image:: https://travis-ci.org/silentsokolov/django-admin-rangefilter.svg?branch=master
   :target: https://travis-ci.org/silentsokolov/django-admin-rangefilter

.. image:: https://codecov.io/gh/silentsokolov/django-admin-rangefilter/branch/master/graph/badge.svg
   :target: https://codecov.io/gh/silentsokolov/django-admin-rangefilter

django-admin-rangefilter
========================

django-admin-rangefilter app, add the filter by a custom date / datetime range on the admin UI.

.. image:: https://raw.githubusercontent.com/silentsokolov/django-admin-rangefilter/master/docs/images/screenshot.png


Requirements
------------

* Python 2.7+ or Python 3.4+
* Django 1.8+


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

Use your favorite Python package manager to install the app from PyPI, e.g.

Example:

``pip install django-admin-rangefilter``


Add ``rangefilter`` to ``INSTALLED_APPS``:

Example:

.. code:: python

    INSTALLED_APPS = (
        ...
        'rangefilter',
        ...
    )


Example usage
-------------

In admin
~~~~~~~~

.. code:: python

    from django.contrib import admin
    from rangefilter.filter import DateRangeFilter, DateTimeRangeFilter

    from .models import Post


    @admin.register(Post)
    class PostAdmin(admin.ModelAdmin):
        list_filter = (
            ('created_at', DateRangeFilter), ('updated_at', DateTimeRangeFilter),
        )


Support Content-Security-Policy
-------------------------------

For Django 1.8+, if `django-csp <https://github.com/mozilla/django-csp>`_ is installed, nonces will be added to style and script tags.

.. code:: python

    INSTALLED_APPS = (
        ...
        'rangefilter',
        'csp',
        ...
    )