Skip to content

Commit 759f2c5

Browse files
Release 0.15.0 (#659)
* Release 0.15.0 * add support for python 3.13 * update dependencies * update dependencies * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * fix mypy * release candidate 10 * Update changelog * Update classifiers * Update classifiers * Release 0.15.0 * Release 0.15.0 --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent 93ed072 commit 759f2c5

13 files changed

Lines changed: 191 additions & 24 deletions

File tree

.github/workflows/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
runs-on: ubuntu-latest
1414
strategy:
1515
matrix:
16-
python-version: [ "3.9", "3.10", "3.11", "3.12" ]
16+
python-version: [ "3.9", "3.10", "3.11", "3.12", "3.13" ]
1717

1818
services:
1919
mongodb:

.pre-commit-config.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,18 +14,18 @@ repos:
1414
- id: end-of-file-fixer
1515
- id: trailing-whitespace
1616
- repo: https://github.com/asottile/pyupgrade
17-
rev: v3.19.0
17+
rev: v3.19.1
1818
hooks:
1919
- id: pyupgrade
2020
args:
2121
- --py38-plus
2222
- repo: https://github.com/astral-sh/ruff-pre-commit
23-
rev: v0.7.1
23+
rev: v0.11.9
2424
hooks:
2525
- id: ruff
2626
args:
2727
- --fix
2828
- repo: https://github.com/psf/black
29-
rev: 24.10.0
29+
rev: 25.1.0
3030
hooks:
3131
- id: black

docs/changelog/index.md

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,85 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres
66
to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## [0.15.0] - 2025-05-21
9+
10+
### Breaking Changes
11+
12+
#### Updated Method Signatures in `ModelView` Class
13+
14+
The following methods in the `ModelView` class now require an additional `request` parameter:
15+
16+
1. **`get_list_query`**
17+
- **Old Signature:** `def get_list_query(self) -> Select`
18+
- **New Signature:** `def get_list_query(self, request: Request) -> Select`
19+
20+
2. **`get_count_query`**
21+
- **Old Signature:** `def get_count_query(self) -> Select`
22+
- **New Signature:** `def get_count_query(self, request: Request) -> Select`
23+
24+
#### Impact on Custom Implementations
25+
26+
If you have extended or overridden the `get_list_query` or `get_count_query` methods in your custom views, you **must
27+
update** their definitions to include the `request` parameter.
28+
29+
#### Example Update
30+
31+
=== "Before"
32+
33+
```python
34+
def get_list_query(self) -> Select:
35+
return super().get_list_query().where(Post.published == true())
36+
```
37+
38+
=== "After"
39+
40+
```python
41+
def get_list_query(self, request: Request) -> Select:
42+
return super().get_list_query(request).where(Post.published == true())
43+
```
44+
45+
### Added
46+
47+
* Implement Beanie ODM Support by [@alexdlukens](https://github.com/alexdlukens)
48+
in [#656](https://github.com/jowilf/starlette-admin/pull/656)
49+
* Add zh_Hant (Traditional Chinese) translation by [@limouren](https://github.com/limouren)
50+
in [#646](https://github.com/jowilf/starlette-admin/pull/646)
51+
* Add `get_details_query` to SQLAlchemy ModelView. by [@nimaxin](https://github.com/nimaxin)
52+
in [#643](https://github.com/jowilf/starlette-admin/pull/643)
53+
* feat(sqla): add support for joined table polymorphic inheritance by [@noamsto](https://github.com/noamsto)
54+
in [#633](https://github.com/jowilf/starlette-admin/pull/633)
55+
* Improve JsonField form template by [@jowilf](https://github.com/jowilf)
56+
in [#639](https://github.com/jowilf/starlette-admin/pull/639)
57+
* bump httpx test dependency by [@pbsds](https://github.com/pbsds)
58+
in [#630](https://github.com/jowilf/starlette-admin/pull/630)
59+
* Allow overriding the default templates by [@jowilf](https://github.com/jowilf)
60+
in [#636](https://github.com/jowilf/starlette-admin/pull/636)
61+
* upgrade tabler to 1.1.0 by [@jowilf](https://github.com/jowilf)
62+
in [#637](https://github.com/jowilf/starlette-admin/pull/637)
63+
* Add support for sqlalchemy `collection_class` property by [@jowilf](https://github.com/jowilf)
64+
in [#625](https://github.com/jowilf/starlette-admin/pull/625)
65+
* feat(base): add redirect_slashes option to mount_to method by [@noamsto](https://github.com/noamsto)
66+
in [#618](https://github.com/jowilf/starlette-admin/pull/618)
67+
* escape row and bulk actions form value in template by [@jowilf](https://github.com/jowilf)
68+
in [#615](https://github.com/jowilf/starlette-admin/pull/615)
69+
* upgrade tabler to beta21 by [@jowilf](https://github.com/jowilf)
70+
in [#599](https://github.com/jowilf/starlette-admin/pull/599)
71+
* Upgrade Odmantic support to v1.0+ by [@jowilf](https://github.com/jowilf)
72+
in [#594](https://github.com/jowilf/starlette-admin/pull/594)
73+
* Add Portuguese translation by [@abnerjacobsen](https://github.com/abnerjacobsen)
74+
in [#480](https://github.com/jowilf/starlette-admin/pull/480)
75+
76+
### Fixed
77+
78+
* Fix dictionary size change exception when using SQLAlchemy `association_proxy` by [@jowilf](https://github.com/jowilf)
79+
in [#624](https://github.com/jowilf/starlette-admin/pull/624)
80+
* Update enum rendering to ensure 'selected' state is applied for data value of 0
81+
by [@tomopy03](https://github.com/tomopy03) in [#621](https://github.com/jowilf/starlette-admin/pull/621)
82+
* escape json value in relation template by [@jowilf](https://github.com/jowilf)
83+
in [#598](https://github.com/jowilf/starlette-admin/pull/598)
84+
* Fix Deprecation Warnings for TemplateResponse and Jinja2Templates by [@ptrstn](https://github.com/ptrstn)
85+
in [#575](https://github.com/jowilf/starlette-admin/pull/575)
86+
887
## [0.14.1] - 2024-07-12
988

1089
### Fixed

examples/sqla_multiple_pks/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
from .config import ENGINE_URI
55

6-
__all__ = ["engine", "Base"]
6+
__all__ = ["Base", "engine"]
77

88
engine = create_engine(ENGINE_URI, connect_args={"check_same_thread": False}, echo=True)
99
Base = declarative_base()

i18n/main.py

Lines changed: 93 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,99 @@ def find_datatable_locale(locale: str) -> Optional[str]:
2929
Returns:
3030
Optional[str]: The matching DataTables locale, or None if not found.
3131
"""
32-
dt_locales = (
33-
"af,sq,am,ar,hy,az-AZ,bn,eu,be,bs-BA,bg,ca,zh,zh-HANT,co,hr,cs,da,nl-NL,en-GB,eo,et,fil,fi,fr-FR,gl,"
34-
"ka,de-DE,el,gu,he,hi,hu,is,id,id-ALT,ga,it-IT,ja,jv,kn,kk,km,ko,ku,ky,lo,lv,lt,ug,mk,ms,mr,mn,ne,"
35-
"no-NB,no-NO,ps,fa,pl,pt-PT,pt-BR,pa,ro,rm,ru,sr,sr-SP,snd,si,sk,sl,es-ES,es-AR,es-CL,es-CO,es-MX,"
36-
"sw,sv-SE,tg,ta,te,th,tr,tk,uk,ur,uz,uz-CR,vi,cy"
37-
).split(",")
32+
dt_locales = [
33+
"af",
34+
"sq",
35+
"am",
36+
"ar",
37+
"hy",
38+
"az-AZ",
39+
"bn",
40+
"eu",
41+
"be",
42+
"bs-BA",
43+
"bg",
44+
"ca",
45+
"zh",
46+
"zh-HANT",
47+
"co",
48+
"hr",
49+
"cs",
50+
"da",
51+
"nl-NL",
52+
"en-GB",
53+
"eo",
54+
"et",
55+
"fil",
56+
"fi",
57+
"fr-FR",
58+
"gl",
59+
"ka",
60+
"de-DE",
61+
"el",
62+
"gu",
63+
"he",
64+
"hi",
65+
"hu",
66+
"is",
67+
"id",
68+
"id-ALT",
69+
"ga",
70+
"it-IT",
71+
"ja",
72+
"jv",
73+
"kn",
74+
"kk",
75+
"km",
76+
"ko",
77+
"ku",
78+
"ky",
79+
"lo",
80+
"lv",
81+
"lt",
82+
"ug",
83+
"mk",
84+
"ms",
85+
"mr",
86+
"mn",
87+
"ne",
88+
"no-NB",
89+
"no-NO",
90+
"ps",
91+
"fa",
92+
"pl",
93+
"pt-PT",
94+
"pt-BR",
95+
"pa",
96+
"ro",
97+
"rm",
98+
"ru",
99+
"sr",
100+
"sr-SP",
101+
"snd",
102+
"si",
103+
"sk",
104+
"sl",
105+
"es-ES",
106+
"es-AR",
107+
"es-CL",
108+
"es-CO",
109+
"es-MX",
110+
"sw",
111+
"sv-SE",
112+
"tg",
113+
"ta",
114+
"te",
115+
"th",
116+
"tr",
117+
"tk",
118+
"uk",
119+
"ur",
120+
"uz",
121+
"uz-CR",
122+
"vi",
123+
"cy",
124+
]
38125
if locale in dt_locales:
39126
return locale
40127
locale = locale.lower()

pyproject.toml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ name = "starlette-admin"
77
description = "Fast, beautiful and extensible administrative interface framework for Starlette/FastApi applications"
88
readme = "README.md"
99
license = "MIT"
10-
requires-python = ">=3.8"
10+
requires-python = ">=3.9"
1111
keywords = ["sqlalchemy", "sqlmodel", "mongoengine", "odmantic", "starlette", "fastapi", "admin", "dashboard", "datatables"]
1212
authors = [
1313
{ name = "Jocelin Hounon", email = "hounonj@gmail.com" },
@@ -21,10 +21,11 @@ classifiers = [
2121
'Operating System :: OS Independent',
2222
'Programming Language :: Python',
2323
'Topic :: Software Development :: Libraries :: Python Modules',
24-
'Programming Language :: Python :: 3.8',
2524
'Programming Language :: Python :: 3.9',
2625
'Programming Language :: Python :: 3.10',
2726
'Programming Language :: Python :: 3.11',
27+
'Programming Language :: Python :: 3.12',
28+
'Programming Language :: Python :: 3.13',
2829
]
2930
dependencies = [
3031
"starlette",
@@ -46,9 +47,9 @@ i18n = [
4647
test = [
4748
"pytest >=8.3.0, <8.4.0",
4849
"pytest-asyncio >=0.24.0, <0.25.0",
49-
"mypy ==1.13.0",
50-
"ruff ==0.7.1",
51-
"black ==24.10.0",
50+
"mypy ==1.15.0",
51+
"ruff ==0.11.9",
52+
"black ==25.1.0",
5253
"httpx >=0.23.3, <0.29.0",
5354
"SQLAlchemy-Utils >=0.40.0, <0.42.0",
5455
"sqlmodel >=0.0.11, <0.1.0",

starlette_admin/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
__version__ = "0.15.0rc9"
1+
__version__ = "0.15.0"
22

33
from ._types import ExportType as ExportType
44
from ._types import RequestAction as RequestAction

starlette_admin/contrib/beanie/helpers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ def resolve_deep_query(
143143
latest_field: Optional[str] = None,
144144
) -> LogicalOperatorForListOfExpressions:
145145
_all_queries = []
146-
for key in where:
146+
for key, _ in where.items():
147147
if key in ["or", "and"]:
148148
_arr = [(resolve_deep_query(q, document, latest_field)) for q in where[key]]
149149
if len(_arr) > 0:

starlette_admin/contrib/mongoengine/helpers.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
import mongoengine.fields as me
55
from mongoengine.base.fields import BaseField as MongoBaseField
6-
from mongoengine.queryset import Q as BaseQ # noqa: N811
6+
from mongoengine.queryset import Q as BaseQ
77
from mongoengine.queryset import QNode
88

99

@@ -67,7 +67,7 @@ def resolve_deep_query(
6767
latest_field: Optional[str] = None,
6868
) -> QNode:
6969
_all_queries = []
70-
for key in where:
70+
for key, _ in where.items():
7171
if key in ["or", "and"]:
7272
_arr = [(resolve_deep_query(q, document, latest_field)) for q in where[key]]
7373
if len(_arr) > 0:

starlette_admin/contrib/odmantic/helpers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ def resolve_deep_query(
108108
field_proxy: t.Optional[FieldProxy] = None,
109109
) -> QueryExpression:
110110
_all_queries = []
111-
for key in where:
111+
for key, _ in where.items():
112112
if key == "or":
113113
_all_queries.append(
114114
query.or_(

0 commit comments

Comments
 (0)