django-jazzmin-admin-rangefilter


Namedjango-jazzmin-admin-rangefilter JSON
Version 1.0.0 PyPI version JSON
download
home_pagehttps://github.com/EricOuma/django-jazzmin-admin-rangefilter
Summarydjango-jazzmin-admin-rangefilter app, add the filter by a custom date range on the Django Jazzmin admin UI.
upload_time2023-03-12 18:37:25
maintainer
docs_urlNone
authorDmitriy Sokolov
requires_python>=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*
licenseMIT
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            .. image:: https://github.com/EricOuma/django-jazzmin-admin-rangefilter/workflows/build/badge.svg?branch=master
   :target: https://github.com/EricOuma/django-jazzmin-admin-rangefilter/actions?query=workflow%3Abuild

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

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

A Django app that adds a filter by date range and numeric range to the Django Jazzmin admin UI.

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


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

* Python 2.7+ or Python 3.6+
* Django 1.8+


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

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

Example:

``pip install django-jazzmin-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.filters import DateRangeFilter, DateTimeRangeFilter, NumericRangeFilter

    from .models import Post


    @admin.register(Post)
    class PostAdmin(admin.ModelAdmin):
        list_filter = (
            ('created_at', DateRangeFilter), ('updated_at', DateTimeRangeFilter),
            ('num_value', NumericRangeFilter),
        )
        
        # If you would like to add a default range filter
        # method pattern "get_rangefilter_{field_name}_default"
        def get_rangefilter_created_at_default(self, request):
            return (datetime.date.today, datetime.date.today)

        # If you would like to change a title range filter
        # method pattern "get_rangefilter_{field_name}_title"
        def get_rangefilter_created_at_title(self, request, field_path):
            return 'custom title'


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.
The setting `ADMIN_RANGEFILTER_NONCE_ENABLED` controls this behavior.

.. code:: python

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

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/EricOuma/django-jazzmin-admin-rangefilter",
    "name": "django-jazzmin-admin-rangefilter",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*",
    "maintainer_email": "",
    "keywords": "",
    "author": "Dmitriy Sokolov",
    "author_email": "silentsokolov@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/30/a2/28e886cba34355bab66c0a22ca6a80849fbbf9e935e3d09a14a38d31c90e/django-jazzmin-admin-rangefilter-1.0.0.tar.gz",
    "platform": "any",
    "description": ".. image:: https://github.com/EricOuma/django-jazzmin-admin-rangefilter/workflows/build/badge.svg?branch=master\n   :target: https://github.com/EricOuma/django-jazzmin-admin-rangefilter/actions?query=workflow%3Abuild\n\n.. image:: https://codecov.io/gh/EricOuma/django-jazzmin-admin-rangefilter/branch/master/graph/badge.svg\n   :target: https://codecov.io/gh/EricOuma/django-jazzmin-admin-rangefilter\n\ndjango-jazzmin-admin-rangefilter\n================================\n\nA Django app that adds a filter by date range and numeric range to the Django Jazzmin admin UI.\n\n.. image:: https://raw.githubusercontent.com/EricOuma/django-jazzmin-admin-rangefilter/master/docs/images/screenshot.png\n\n\nRequirements\n------------\n\n* Python 2.7+ or Python 3.6+\n* Django 1.8+\n\n\nInstallation\n------------\n\nUse your favorite Python package manager to install the app from PyPI, e.g.\n\nExample:\n\n``pip install django-jazzmin-admin-rangefilter``\n\n\nAdd ``rangefilter`` to ``INSTALLED_APPS``:\n\nExample:\n\n.. code:: python\n\n    INSTALLED_APPS = (\n        ...\n        'rangefilter',\n        ...\n    )\n\n\nExample usage\n-------------\n\nIn admin\n~~~~~~~~\n\n.. code:: python\n\n    from django.contrib import admin\n    from rangefilter.filters import DateRangeFilter, DateTimeRangeFilter, NumericRangeFilter\n\n    from .models import Post\n\n\n    @admin.register(Post)\n    class PostAdmin(admin.ModelAdmin):\n        list_filter = (\n            ('created_at', DateRangeFilter), ('updated_at', DateTimeRangeFilter),\n            ('num_value', NumericRangeFilter),\n        )\n        \n        # If you would like to add a default range filter\n        # method pattern \"get_rangefilter_{field_name}_default\"\n        def get_rangefilter_created_at_default(self, request):\n            return (datetime.date.today, datetime.date.today)\n\n        # If you would like to change a title range filter\n        # method pattern \"get_rangefilter_{field_name}_title\"\n        def get_rangefilter_created_at_title(self, request, field_path):\n            return 'custom title'\n\n\nSupport Content-Security-Policy\n-------------------------------\n\nFor Django 1.8+, if `django-csp <https://github.com/mozilla/django-csp>`_ is installed, nonces will be added to style and script tags.\nThe setting `ADMIN_RANGEFILTER_NONCE_ENABLED` controls this behavior.\n\n.. code:: python\n\n    INSTALLED_APPS = (\n        ...\n        'rangefilter',\n        'csp',\n        ...\n    )\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "django-jazzmin-admin-rangefilter app, add the filter by a custom date range on the Django Jazzmin admin UI.",
    "version": "1.0.0",
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "4b69955f29ffddf5bc04c9f10c2d770bf9a1ca1fc7081b4db709f19fb2b581b3",
                "md5": "f12f2fe992a241132e616b4cdd96d711",
                "sha256": "146e44fece16e842177ad092300dd35bac6008e1b683af8a39e93c3d4709f386"
            },
            "downloads": -1,
            "filename": "django_jazzmin_admin_rangefilter-1.0.0-py2.py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "f12f2fe992a241132e616b4cdd96d711",
            "packagetype": "bdist_wheel",
            "python_version": "py2.py3",
            "requires_python": ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*",
            "size": 44120,
            "upload_time": "2023-03-12T18:37:23",
            "upload_time_iso_8601": "2023-03-12T18:37:23.640204Z",
            "url": "https://files.pythonhosted.org/packages/4b/69/955f29ffddf5bc04c9f10c2d770bf9a1ca1fc7081b4db709f19fb2b581b3/django_jazzmin_admin_rangefilter-1.0.0-py2.py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "30a228e886cba34355bab66c0a22ca6a80849fbbf9e935e3d09a14a38d31c90e",
                "md5": "939520908f8e468adaed7e59a369de92",
                "sha256": "877a9eaffdd5857d0d9ce438669b96a8827e3a2ecfec2522902176fdc7060c79"
            },
            "downloads": -1,
            "filename": "django-jazzmin-admin-rangefilter-1.0.0.tar.gz",
            "has_sig": false,
            "md5_digest": "939520908f8e468adaed7e59a369de92",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*",
            "size": 21605,
            "upload_time": "2023-03-12T18:37:25",
            "upload_time_iso_8601": "2023-03-12T18:37:25.330083Z",
            "url": "https://files.pythonhosted.org/packages/30/a2/28e886cba34355bab66c0a22ca6a80849fbbf9e935e3d09a14a38d31c90e/django-jazzmin-admin-rangefilter-1.0.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-03-12 18:37:25",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "github_user": "EricOuma",
    "github_project": "django-jazzmin-admin-rangefilter",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "django-jazzmin-admin-rangefilter"
}
        
Elapsed time: 0.08928s