Features: 1) Add "dalf" package to dependencies for enhancing Django admin list_filter capabilities; 2) Update "notebook" package to version 7.4.4 and adjust its dependencies; 3) Integrate "dalf" filters in admin list_filter configuration;
Fixes: 1) Correct admin list_filter configurations with appropriate DALF fields; Extra: 1) Update PyCharm project settings to use Google-style docstrings.
This commit is contained in:
parent
83cad6c1cc
commit
9591494fee
5 changed files with 29 additions and 9 deletions
|
|
@ -1,8 +1,8 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module version="4">
|
||||
<component name="PyDocumentationSettings">
|
||||
<option name="format" value="PLAIN" />
|
||||
<option name="myDocStringFormat" value="Plain" />
|
||||
<option name="format" value="GOOGLE" />
|
||||
<option name="myDocStringFormat" value="Google" />
|
||||
</component>
|
||||
<component name="TemplatesService">
|
||||
<option name="TEMPLATE_FOLDERS">
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@ from contextlib import suppress
|
|||
|
||||
from constance.admin import Config
|
||||
from constance.admin import ConstanceAdmin as BaseConstanceAdmin
|
||||
from dalf.admin import DALFRelatedFieldAjax, DALFRelatedOnlyField
|
||||
from django.apps import apps
|
||||
from django.contrib import admin
|
||||
from django.contrib.admin import ModelAdmin, TabularInline
|
||||
|
|
@ -239,8 +240,10 @@ class ProductAdmin(FieldsetsMixin, BasicModelAdmin):
|
|||
list_filter = (
|
||||
"is_active",
|
||||
"is_digital",
|
||||
("tags", admin.RelatedOnlyFieldListFilter),
|
||||
("stocks__vendor", admin.RelatedOnlyFieldListFilter),
|
||||
("brand", DALFRelatedFieldAjax),
|
||||
("category", DALFRelatedFieldAjax),
|
||||
("tags", DALFRelatedOnlyField),
|
||||
("stocks__vendor", DALFRelatedOnlyField),
|
||||
"created",
|
||||
"modified",
|
||||
)
|
||||
|
|
|
|||
|
|
@ -116,6 +116,7 @@ INSTALLED_APPS: list[str] = [
|
|||
"health_check.contrib.psutil",
|
||||
"health_check.contrib.db_heartbeat",
|
||||
"cacheops",
|
||||
"dalf",
|
||||
"django_hosts",
|
||||
"django_celery_beat",
|
||||
"django_celery_results",
|
||||
|
|
|
|||
25
poetry.lock
generated
25
poetry.lock
generated
|
|
@ -957,6 +957,21 @@ ssh = ["bcrypt (>=3.1.5)"]
|
|||
test = ["certifi (>=2024)", "cryptography-vectors (==45.0.4)", "pretend (>=0.7)", "pytest (>=7.4.0)", "pytest-benchmark (>=4.0)", "pytest-cov (>=2.10.1)", "pytest-xdist (>=3.5.0)"]
|
||||
test-randomorder = ["pytest-randomly"]
|
||||
|
||||
[[package]]
|
||||
name = "dalf"
|
||||
version = "0.3.0"
|
||||
description = "Dead simple autocompletion for Django admin list_filter with goodies."
|
||||
optional = false
|
||||
python-versions = ">=3.11"
|
||||
files = [
|
||||
{file = "dalf-0.3.0-py3-none-any.whl", hash = "sha256:432f1981ba56bf1d86ad2cfd582cf44e759d06d1ea19252cff37c7868c0944f4"},
|
||||
{file = "dalf-0.3.0.tar.gz", hash = "sha256:0133b21bb2a3101e07f6eaa76635bca1c56ff5090edc773705b04cfe7bcea97b"},
|
||||
]
|
||||
|
||||
[package.extras]
|
||||
build = ["build", "twine"]
|
||||
dev = ["Django", "pytest", "pytest-cov", "pytest-django", "pytest-factoryboy"]
|
||||
|
||||
[[package]]
|
||||
name = "debugpy"
|
||||
version = "1.8.14"
|
||||
|
|
@ -3127,18 +3142,18 @@ files = [
|
|||
|
||||
[[package]]
|
||||
name = "notebook"
|
||||
version = "7.4.3"
|
||||
version = "7.4.4"
|
||||
description = "Jupyter Notebook - A web-based notebook environment for interactive computing"
|
||||
optional = true
|
||||
python-versions = ">=3.8"
|
||||
files = [
|
||||
{file = "notebook-7.4.3-py3-none-any.whl", hash = "sha256:9cdeee954e04101cadb195d90e2ab62b7c9286c1d4f858bf3bb54e40df16c0c3"},
|
||||
{file = "notebook-7.4.3.tar.gz", hash = "sha256:a1567481cd3853f2610ee0ecf5dfa12bb508e878ee8f92152c134ef7f0568a76"},
|
||||
{file = "notebook-7.4.4-py3-none-any.whl", hash = "sha256:32840f7f777b6bff79bb101159336e9b332bdbfba1495b8739e34d1d65cbc1c0"},
|
||||
{file = "notebook-7.4.4.tar.gz", hash = "sha256:392fd501e266f2fb3466c6fcd3331163a2184968cb5c5accf90292e01dfe528c"},
|
||||
]
|
||||
|
||||
[package.dependencies]
|
||||
jupyter-server = ">=2.4.0,<3"
|
||||
jupyterlab = ">=4.4.3,<4.5"
|
||||
jupyterlab = ">=4.4.4,<4.5"
|
||||
jupyterlab-server = ">=2.27.1,<3"
|
||||
notebook-shim = ">=0.2,<0.3"
|
||||
tornado = ">=6.2.0"
|
||||
|
|
@ -5136,4 +5151,4 @@ worker = ["celery", "celery-prometheus-exporter", "django-celery-beat", "django-
|
|||
[metadata]
|
||||
lock-version = "2.0"
|
||||
python-versions = ">=3.12,<3.13"
|
||||
content-hash = "58d67f7b6c2313bdb117965a9c9555319bbb059db043e5723d39a27c36695939"
|
||||
content-hash = "14a6ba1e4527014e4883c987b0342cf0e7dacea6cd9ef3a97acde6f7660a39fc"
|
||||
|
|
|
|||
|
|
@ -13,6 +13,7 @@ celery-prometheus-exporter = { version = "1.7.0", optional = true }
|
|||
colorlog = "6.9.0"
|
||||
click = "8.2.1"
|
||||
cryptography = "45.0.4"
|
||||
dalf = "0.3.0"
|
||||
django = "5.2"
|
||||
django-cacheops = "7.2"
|
||||
django-celery-beat = { version = "2.8.1", optional = true }
|
||||
|
|
|
|||
Loading…
Reference in a new issue