chore: documentation (#76)

* chore: update docstring example to use python code block

* docs: add documentation

* feat: add docs build + fix other workdlows

* fix: add missing return type
This commit is contained in:
d3vyce
2026-02-19 16:43:38 +01:00
committed by GitHub
parent 73fae04333
commit 6714ceeb92
42 changed files with 2008 additions and 40 deletions

View File

@@ -38,12 +38,14 @@ def PathDependency(
NotFoundError: If no matching record is found
Example:
```python
UserDep = PathDependency(User, User.id, session_dep=get_db)
@router.get("/user/{id}")
async def get(
user: User = UserDep,
): ...
```
"""
crud = CrudFactory(model)
name = (
@@ -102,6 +104,7 @@ def BodyDependency(
NotFoundError: If no matching record is found
Example:
```python
UserDep = BodyDependency(
User, User.ctfd_id, session_dep=get_db, body_field="user_id"
)
@@ -110,6 +113,7 @@ def BodyDependency(
async def assign(
user: User = UserDep,
): ...
```
"""
crud = CrudFactory(model)
python_type = field.type.python_type