django-admin-daterange-listfilter
为Django模型列表页的时间过滤器增加日期范围选择功能。
使用方法
简化集成(django-app-requires)
本项目通过 app_requires 声明了依赖的 Django 应用,结合 django-app-requires 可自动补全 INSTALLED_APPS 中的依赖项,无需手动添加:
INSTALLED_APPS = [
...
"django_admin_daterange_listfilter",
...
]
# 在 settings.py 末尾
from django_app_requires import patch_all as django_app_requires_patch_all
django_app_requires_patch_all()
patch_all() 会自动将 app_requires 中声明的依赖(如 django_static_jquery_ui 等)追加到 INSTALLED_APPS。
传统手动配置
settings.py
INSTALLED_APPS = [
...
"django_static_jquery_ui",
"django_middleware_global_request",
"django_listfilter_media_extension",
"django_admin_daterange_listfilter",
...
]
MIDDLEWARE = [
...
"django_middleware_global_request.middleware.GlobalRequestMiddleware",
...
]
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.
v0.1.7
- 修复 QueryDict 参数值为 list 类型时触发 TypeError 的问题。
- 修复无效日期输入导致 500 异常的问题。
- 修复
params就地修改产生副作用的问题。 - 修复 JavaScript 使用非标准
window.location.query的兼容性问题。 - 新增单测覆盖正常/非法/空/列表参数/时区等场景。
- 更新
.po翻译文件头部信息。 - 迁移打包配置至
pyproject.toml。 - 添加
build.sh构建脚本。
v0.1.8
- 添加项目仓库链接至
pyproject.toml。 - 更新文档说明。
v0.1.9
- 修复 Django 5.2 中
'datetime.datetime' object is not iterable错误。
Metadata
Release files for django-admin-daterange-listfilter 0.1.9
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| django_admin_daterange_listfilter-0.1.9.tar.gz | 10.2 kB | Without provenance | Details for django_admin_daterange_listfilter-0.1.9.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| django_admin_daterange_listfilter-0.1.9-py3-none-any.whl | Python 3 | none | any | Details for django_admin_daterange_listfilter-0.1.9-py3-none-any.whl |
Total release size: 22.1 kB
Release files / django_admin_daterange_listfilter-0.1.9.tar.gz
| Download URL | django_admin_daterange_listfilter-0.1.9.tar.gz |
|---|---|
| Size | 10.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
833d4b4b8dde652366e87c9b6ef18c6dd937775d8011e5e793e88061b5d1e410
|
|
BLAKE2b-256 checksum How to use checksums |
edd3aecdd5e06aa6bd9fa0d31b004312100a839009f83b94a358c742d3104ff1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.9
|
Release files / django_admin_daterange_listfilter-0.1.9-py3-none-any.whl
| Download URL | django_admin_daterange_listfilter-0.1.9-py3-none-any.whl |
|---|---|
| Size | 11.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
14fbaf8643444e378f18ac2019fdad1eb5c66560eb644a963c6289e4c976541b
|
|
BLAKE2b-256 checksum How to use checksums |
0593f7dd40cb1f41079d3f8641477ba72bf4c96f114ead728b23bc3a7f8a441a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.9
|
Security for django-admin-daterange-listfilter 0.1.9
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.