Skip to main content

为Django模型列表页的时间过滤器增加日期范围选择功能。

Project description

django-admin-daterange-listfilter

为Django模型列表页的时间过滤器增加日期范围选择功能。

使用方法

settings.py

INSTALLED_APPS = [
    ...
    "django_static_jquery_ui",
    "django_middleware_global_request",
    "django_listfilter_media_extension",
    "django_admin_daterange_listfilter",
    ...
]

admin.py

from django.contrib import admin
from django_admin_daterange_listfilter.filters import DateRangeFilter
from .models import Category


class CategoryAdmin(admin.ModelAdmin):
    list_display = [
        "title",
        "add_time",
        "mod_time",
    ]
    list_filter = [
        ("add_time", DateRangeFilter),
        ("mod_time", DateRangeFilter),
    ]


admin.site.register(Category, CategoryAdmin)

版本记录

v0.1.0

  • 版本首发。

v0.1.4

  • 添加中文i18n翻译。

v0.1.5

  • 添加default_app_config以增强兼容性。

v0.1.6

  • Doc update.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django_admin_daterange_listfilter-0.1.6.tar.gz (9.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

File details

Details for the file django_admin_daterange_listfilter-0.1.6.tar.gz.

File metadata

File hashes

Hashes for django_admin_daterange_listfilter-0.1.6.tar.gz
Algorithm Hash digest
SHA256 5c958413750e30f7f53306836400306e979f7a8df3aed813fce8eddc0be86693
MD5 fecdffbc57a6c4c567b18b890ea9b65b
BLAKE2b-256 00ce70bcb3989bd0d303f9a299c8c94d282071a96906ae2e54a2eaf30aed4eca

See more details on using hashes here.

File details

Details for the file django_admin_daterange_listfilter-0.1.6-py3-none-any.whl.

File metadata

File hashes

Hashes for django_admin_daterange_listfilter-0.1.6-py3-none-any.whl
Algorithm Hash digest
SHA256 70a696c8f79e98c9dcb82b04e9b295ee3dde319da0dc8b4160a21136a7f57fdf
MD5 ff8c6e50444a4c6a7fb2d406203e6fb0
BLAKE2b-256 3056d9600f2b1a2251a372097c29573a49f94292cb302e03f4121490df24c1e3

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page