Skip to content

Commit b2915b3

Browse files
committed
Audit docs against code: fix inaccuracies found in review
- dashboard-widgets: add missing WidgetActionChartProps import to example - form-widgets: clarify PasswordInput auto change_password is create-only - authentication: authenticate must return int or UUID, not str - model-admins: describe save_as_continue default (changelist redirect) - quickstart: note the bcrypt example field names are illustrative - contributing/index: replace stale mypy references with ty - Makefile: build docs social cards only in CI (needs Cairo system libs)
1 parent 33b5002 commit b2915b3

8 files changed

Lines changed: 14 additions & 7 deletions

File tree

Makefile

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,10 @@ test:
3434
cov: test
3535

3636
# --- Documentation (MkDocs Material) -----------------------------------------
37-
# Build the static site into ./site (social cards enabled, like CI).
37+
# Build the static site into ./site. Social cards are generated only in CI
38+
# (the docs workflow installs the Cairo system libraries they need).
3839
docs:
39-
CI=true uv run --group docs mkdocs build --strict
40+
uv run --group docs mkdocs build --strict
4041

4142
# Live-preview at http://127.0.0.1:8000 (social cards off for speed).
4243
docs-serve:

docs/contributing.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ make dev # uv sync --all-extras + frontend yarn install
3333

3434
| Command | What it does |
3535
| --- | --- |
36-
| `make lint` | ruff check + ruff format --check + mypy, then the frontend linters. |
36+
| `make lint` | ruff check + ruff format --check + ty, then the frontend linters. |
3737
| `make format` | Auto-fix lint issues and reformat (Python + frontend). |
3838
| `make test` | Backend tests with a **100% coverage gate**, then frontend tests. |
3939
| `make build` | Build the frontend into `fastadmin/static` and the wheel/sdist via `uv build`. |

docs/getting-started/quickstart.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,11 @@ class UserAdmin(TortoiseModelAdmin):
9393
(and `change_password` if you want password editing). See
9494
[Authentication](../guides/authentication.md).
9595

96+
!!! note
97+
98+
Adapt the field names (`hash_password`, `is_active`, …) to your own user
99+
model — the snippet above shows the recommended bcrypt-hashed setup.
100+
96101
## 3. Run it
97102

98103
Start your app as usual (e.g. `uvicorn example:app` for FastAPI) and open

docs/guides/authentication.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ class UserAdmin(TortoiseModelAdmin):
4343

4444
- `authenticate(username, password)` receives the value of the
4545
`ADMIN_USER_MODEL_USERNAME_FIELD` field and the password, and returns a user
46-
id (`int`, `str` or `UUID`) or `None`.
46+
id (`int` or `UUID`) or `None`.
4747
- `change_password(id, password)` stores a new password. FastAdmin also calls
4848
it automatically after creating an object whose form contains a
4949
`PasswordInput` widget, so passwords are stored hashed.

docs/guides/dashboard-widgets.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,7 @@ with a list of data rows:
103103

104104
```python
105105
from fastadmin import (
106+
WidgetActionChartProps,
106107
WidgetActionFilter,
107108
WidgetActionInputSchema,
108109
WidgetActionResponseSchema,

docs/guides/form-widgets.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ components. Every widget type is available via the `WidgetType` enum:
1818
| `EmailInput` | Email input |
1919
| `PhoneInput` | Phone input with country codes |
2020
| `UrlInput` | URL input |
21-
| `PasswordInput` | Password input (values are stored via `change_password`) |
21+
| `PasswordInput` | Password input (on create, the value is stored via `change_password`) |
2222
| `TextArea` | Multi-line text |
2323
| `RichTextArea` | Rich-text (WYSIWYG) editor |
2424
| `JsonTextArea` | JSON editor |

docs/guides/model-admins.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ attributes are optional and mirror Django Admin where possible.
4343
| `radio_fields` | `()` | Use radio buttons instead of a select for FK/choice fields. |
4444
| `raw_id_fields` | `()` | Use a plain input instead of a select for FK/M2M fields. |
4545
| `save_as` | `False` | Replace "Save and add another" with "Save as new". |
46-
| `save_as_continue` | `False` | Redirect to the change view after "Save as new". |
46+
| `save_as_continue` | `False` | Where "Save as new" redirects: the changelist by default, or the new object's change view when `True`. |
4747
| `save_on_top` | `False` | Show save buttons at the top of the form too. |
4848
| `view_on_site` | `None` | URL for a "View on site" link. |
4949
| `inlines` | `()` | Inline admin classes — see [Inline admins](inline-admins.md). |

docs/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ app.mount("/admin", admin_app)
6161
(line, area, column, bar, pie) with filters, powered by antd charts.
6262
- :outbox_tray: **Uploads & exports** — file/image upload widgets with
6363
custom storage hooks, CSV/JSON export out of the box.
64-
- :test_tube: **Quality** — fully linted (ruff), typed (mypy) and tested with
64+
- :test_tube: **Quality** — fully linted (ruff), typed (ty) and tested with
6565
100% backend coverage.
6666

6767
## Explore the docs

0 commit comments

Comments
 (0)