Skip to content

Commit d5a3edf

Browse files
authored
Merge branch 'main' into do-not-join-same-model-twice-in-search-query
2 parents 9654a9a + 5709b9a commit d5a3edf

13 files changed

Lines changed: 52 additions & 16 deletions

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ Main features include:
3939

4040
---
4141

42-
**Documentation**: [https://aminalaee.dev/sqladmin](https://aminalaee.dev/sqladmin)
42+
**Documentation**: [https://aminalaee.github.io/sqladmin](https://aminalaee.github.io/sqladmin)
4343

4444
**Source Code**: [https://github.com/aminalaee/sqladmin](https://github.com/aminalaee/sqladmin)
4545

docs/authentication.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ The class `AuthenticationBackend` has three methods you need to override:
1010

1111
* `authenticate`: Will be called for validating each incoming request.
1212
* `login`: Will be called only in the login page to validate username/password.
13-
* `logout`: Will be called only for the logout, usually clearin the session.
13+
* `logout`: Will be called only for the logout, usually clearing the session.
1414

1515
```python
1616
from sqladmin import Admin

docs/configurations.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,10 @@ The forms are based on `WTForms` package and include the following options:
226226
form_edit_rules = ["name"]
227227
```
228228

229+
### Related models
230+
231+
To define how related model is displayed in the dropdown, `__str__` method must be difined in the related model.
232+
229233
## Export options
230234

231235
SQLAdmin supports exporting data in the list page. Currently only CSV export is supported.

docs/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ Main features include:
3939

4040
---
4141

42-
**Documentation**: [https://aminalaee.dev/sqladmin](https://aminalaee.dev/sqladmin)
42+
**Documentation**: [https://aminalaee.github.io/sqladmin](https://aminalaee.github.io/sqladmin)
4343

4444
**Source Code**: [https://github.com/aminalaee/sqladmin](https://github.com/aminalaee/sqladmin)
4545

docs/model_convertors.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44

55
Model Converters are special classes used to convert SQLAlchemy model properties into web interface form fields. They allow you to customize how backend SQLAlchemy models are represented in the admin interface, providing flexibility in handling different data types and validation rules.
66

7-
This page will guide you through the basics of using and customizing Model Converters. For advanced usage, refer to the [API Reference](./api_reference/model_converter.md).
8-
97
---
108

119
## Overview

docs/working_with_files.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,4 +57,4 @@ and displayed in the admin dashboard.
5757

5858
You can replace `FileSystemStorage` with `S3Storage` to upload to S3 or any S3-compatible API.
5959

60-
For complete features and API reference of the `fastapi-storages` you can visit the docs at [https://aminalaee.dev/fastapi-storages](https://aminalaee.dev/fastapi-storages).
60+
For complete features and API reference of the `fastapi-storages` you can visit the docs at [https://aminalaee.github.io/fastapi-storages](https://aminalaee.github.io/fastapi-storages).

mkdocs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
site_name: SQLAlchemy Admin
22
site_description: Flexible admin dashboard for SQLAlchemy.
3-
site_url: https://aminalaee.dev/sqladmin
3+
site_url: https://aminalaee.github.io/sqladmin/
44

55
theme:
66
name: "material"

pyproject.toml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ full = [
4141
]
4242

4343
[project.urls]
44-
Documentation = "https://aminalaee.dev/sqladmin"
44+
Documentation = "https://aminalaee.github.io/sqladmin/"
4545
Issues = "https://github.com/aminalaee/sqladmin/issues"
4646
Source = "https://github.com/aminalaee/sqladmin"
4747

@@ -93,9 +93,9 @@ dependencies = [
9393

9494
[tool.hatch.envs.docs]
9595
dependencies = [
96-
"mkdocs-material==9.1.3",
97-
"mkdocs==1.4.2",
98-
"mkdocstrings[python]==0.25.0",
96+
"mkdocs-material==9.6.14",
97+
"mkdocs==1.6.1",
98+
"mkdocstrings[python]==0.26.1",
9999
]
100100

101101
[tool.hatch.envs.test.scripts]

sqladmin/_menu.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ def type_(self) -> str:
4444
class CategoryMenu(ItemMenu):
4545
def is_active(self, request: Request) -> bool:
4646
return any(
47-
c.is_visible(request) and c.is_accessible(request) for c in self.children
47+
c.is_active(request) and c.is_accessible(request) for c in self.children
4848
)
4949

5050
@property

sqladmin/application.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -638,7 +638,11 @@ async def login(self, request: Request) -> Response:
638638
async def logout(self, request: Request) -> Response:
639639
assert self.authentication_backend is not None
640640

641-
await self.authentication_backend.logout(request)
641+
response = await self.authentication_backend.logout(request)
642+
643+
if isinstance(response, Response):
644+
return response
645+
642646
return RedirectResponse(request.url_for("admin:index"), status_code=302)
643647

644648
async def ajax_lookup(self, request: Request) -> Response:

0 commit comments

Comments
 (0)