Skip to content

Commit 62f4392

Browse files
committed
Bump version
1 parent 1e4e221 commit 62f4392

3 files changed

Lines changed: 63 additions & 6 deletions

File tree

docs/build.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,17 @@ def read_cls_docstring(cls):
4242

4343
def get_versions():
4444
return [
45+
{
46+
"version": "0.3.5",
47+
"changes": [
48+
"Enhance get_orm_list method to support prefetch_related_fields and additional_search_fields.",
49+
"Add request/user context on BaseModelAdmin for per-request custom logic.",
50+
],
51+
},
4552
{
4653
"version": "0.3.4",
4754
"changes": [
4855
"Fix sort by and search by relations. Fix examples.",
49-
"Add request/user context on BaseModelAdmin for per-request custom logic.",
5056
],
5157
},
5258
{

docs/index.html

Lines changed: 55 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,10 @@ <h4 class="title">FastAdmin</h4>
196196

197197
<ul class="nav flex-column">
198198

199+
<li class="nav-item">
200+
<a class="nav-link" href="#v0_3_5">v0.3.5</a>
201+
</li>
202+
199203
<li class="nav-item">
200204
<a class="nav-link" href="#v0_3_4">v0.3.4</a>
201205
</li>
@@ -323,7 +327,7 @@ <h1>FastAdmin | Documentation</h1>
323327
<div class="row">
324328
<div class="col-sm-6 col-lg-4">
325329
<ul class="list-unstyled">
326-
<li><strong>Version:</strong> 0.3.4</li>
330+
<li><strong>Version:</strong> 0.3.5</li>
327331
<li>
328332
<strong>Author:</strong>
329333
<a href="mailto:vsdudakov@gmail.com" target="_blank">
@@ -1643,6 +1647,9 @@ <h3>Methods and Attributes</h3>
16431647
<pre>
16441648
<code class="language-python">
16451649
class DashboardWidgetAdmin:
1650+
_request_context: ContextVar[Any | None]
1651+
_user_context: ContextVar[Any | None]
1652+
16461653
title: str
16471654
dashboard_widget_type: DashboardWidgetType
16481655
x_field: str
@@ -1652,6 +1659,25 @@ <h3>Methods and Attributes</h3>
16521659
x_field_filter_widget_props: dict[str, Any] | None = None
16531660
x_field_periods: list[str] | None = None
16541661

1662+
def __init__(self) -> None:
1663+
self._request_context = ContextVar(f"fastadmin_dashboard_request_context_{id(self)}", default=None)
1664+
self._user_context = ContextVar(f"fastadmin_dashboard_user_context_{id(self)}", default=None)
1665+
1666+
@property
1667+
def request(self) -> Any | None:
1668+
"""Current request object for this async context."""
1669+
return self._request_context.get()
1670+
1671+
@property
1672+
def user(self) -> Any | None:
1673+
"""Current authenticated user object for this async context."""
1674+
return self._user_context.get()
1675+
1676+
def set_context(self, request: Any | None = None, user: Any | None = None) -> None:
1677+
"""Set request/user context for the current async task."""
1678+
self._request_context.set(request)
1679+
self._user_context.set(user)
1680+
16551681
async def get_data(
16561682
self,
16571683
min_x_field: str | None = None,
@@ -3389,13 +3415,13 @@ <h2>Changelog</h2>
33893415

33903416

33913417

3392-
<section id="v0_3_4">
3393-
<h3>v0.3.4</h3>
3418+
<section id="v0_3_5">
3419+
<h3>v0.3.5</h3>
33943420

33953421

33963422

33973423
<p class="text-4">
3398-
Fix sort by and search by relations. Fix examples.
3424+
Enhance get_orm_list method to support prefetch_related_fields and additional_search_fields.
33993425
</p>
34003426

34013427

@@ -3429,6 +3455,31 @@ <h3>v0.3.4</h3>
34293455

34303456

34313457

3458+
</section>
3459+
3460+
3461+
<section id="v0_3_4">
3462+
<h3>v0.3.4</h3>
3463+
3464+
3465+
3466+
<p class="text-4">
3467+
Fix sort by and search by relations. Fix examples.
3468+
</p>
3469+
3470+
3471+
3472+
3473+
3474+
3475+
3476+
3477+
3478+
3479+
3480+
3481+
3482+
34323483
</section>
34333484

34343485

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "fastadmin"
3-
version = "0.3.4"
3+
version = "0.3.5"
44
description = "FastAdmin is an easy-to-use Admin Dashboard App for FastAPI/Flask/Django inspired by Django Admin."
55
authors = ["Seva D <vsdudakov@gmail.com>"]
66
license = "MIT"

0 commit comments

Comments
 (0)