All Projects → silentsokolov → Django Admin Rangefilter

silentsokolov / Django Admin Rangefilter

Licence: mit
django-admin-rangefilter app, add the filter by a custom date range on the admin UI

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Django Admin Rangefilter

Coreui Free Laravel Admin Template
CoreUI Free Laravel Bootstrap Admin Template
Stars: ✭ 353 (-4.59%)
Mutual labels:  admin-ui
Django Fobi
Form generator/builder application for Django done right: customisable, modular, user- and developer- friendly.
Stars: ✭ 360 (-2.7%)
Mutual labels:  django
Vue Framework Wz
👏vue后台管理框架👏
Stars: ✭ 3,757 (+915.41%)
Mutual labels:  admin-ui
Collectfast
A faster collectstatic command.
Stars: ✭ 352 (-4.86%)
Mutual labels:  django
Try Django 1.11
Learn the fundamentals behind one of the most popular web frameworks in the world: Django. We will teach you step-by-step how to implement concepts like Views, Template Rendering, Forms, Saving Data, URL routing, Deployment aka Going Live, and so much more. Django is a web-framework written in Python and runs the backend for many of the internet's most popular websites such as Instagram and Pinterest. Get started today!
Stars: ✭ 359 (-2.97%)
Mutual labels:  django
Django Tutorial
Django 基本教學 - 從無到有 Django-Beginners-Guide 📝
Stars: ✭ 365 (-1.35%)
Mutual labels:  django
Channels Api
RESTful Websocket APIs with Django Rest Framework and Channels
Stars: ✭ 353 (-4.59%)
Mutual labels:  django
Django User Sessions
Extend Django sessions with a foreign key back to the user, allowing enumerating all user's sessions.
Stars: ✭ 368 (-0.54%)
Mutual labels:  django
Django Bakery
A set of helpers for baking your Django site out as flat files
Stars: ✭ 360 (-2.7%)
Mutual labels:  django
Django Blog
django搭建博客
Stars: ✭ 365 (-1.35%)
Mutual labels:  django
Graphene Django Extras
Extras functionalities for Graphene-Django
Stars: ✭ 356 (-3.78%)
Mutual labels:  django
Django Watchman
django-watchman exposes a status endpoint for your backing services like databases, caches, etc.
Stars: ✭ 357 (-3.51%)
Mutual labels:  django
Firefox Profilemaker
Tool to create firefox profiles with good defaults.
Stars: ✭ 361 (-2.43%)
Mutual labels:  django
Vmaig blog
an opensource blog system based on django 2.2 and bootstrap https://vmaig.com
Stars: ✭ 354 (-4.32%)
Mutual labels:  django
Healthchecks
A cron monitoring tool written in Python & Django
Stars: ✭ 4,297 (+1061.35%)
Mutual labels:  django
Django Sekizai
Django Template Blocks with extra functionality
Stars: ✭ 353 (-4.59%)
Mutual labels:  django
Pretalx
Conference planning tool: CfP, scheduling, speaker management
Stars: ✭ 363 (-1.89%)
Mutual labels:  django
Django Getpaid
Django payments processor.
Stars: ✭ 371 (+0.27%)
Mutual labels:  django
Django Api Domains
A pragmatic styleguide for Django API Projects
Stars: ✭ 365 (-1.35%)
Mutual labels:  django
Django Postgres Extra
Bringing all of PostgreSQL's awesomeness to Django.
Stars: ✭ 365 (-1.35%)
Mutual labels:  django

.. image:: https://github.com/silentsokolov/django-admin-rangefilter/workflows/build/badge.svg?branch=master :target: https://github.com/silentsokolov/django-admin-rangefilter/actions?query=workflow%3Abuild

.. 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),
        )
        
        # 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.

.. code:: python

    INSTALLED_APPS = (
        ...
        'rangefilter',
        'csp',
        ...
    )
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].