Skip to content

Commit

Permalink
🎨 [pre-commit.ci] Auto format from pre-commit.com hooks
Browse files Browse the repository at this point in the history
  • Loading branch information
pre-commit-ci[bot] committed Feb 12, 2024
1 parent 46320fe commit 6b5f287
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions docs/advanced/change-default-type-mapping.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,10 @@ def map_python_type_to_sa_type(type_: "PythonType", meta: "PydanticMeta", annota

## Current mapping

| Python type | SqlAlchemy type |
| Python type | SqlAlchemy type |
|-----------------------|------------------------------------------------------------------------------------------------------------------------------------|
| Enum | `lambda type_, meta, annotation: sa_Enum(type_)` |
| str | `lambda type_, meta, annotation: AutoString(length=getattr(meta, "max_length", None))` |
| str | `lambda type_, meta, annotation: AutoString(length=getattr(meta, "max_length", None))` |
| float | Float |
| bool | Boolean |
| int | Integer |
Expand All @@ -67,4 +67,4 @@ def map_python_type_to_sa_type(type_: "PythonType", meta: "PydanticMeta", annota
| ipaddress.IPv6Network | AutoString |
| Path | AutoString |
| uuid.UUID | Uuid |
| BaseModel | `lambda type_, meta, annotation: PydanticJSONType(type=annotation)` |
| BaseModel | `lambda type_, meta, annotation: PydanticJSONType(type=annotation)` |
4 changes: 2 additions & 2 deletions docs/advanced/pydantic-json-type.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ Then map Stats to Hero as shown bellow:
{!./docs_src/advanced/pydantic_json_type/tutorial002.py[ln:36-39]!}
```

After all of these actions we can change mutated model, and it will be saved to database after we call `session.commit()`
After all of these actions we can change mutated model, and it will be saved to database after we call `session.commit()`

```{.python .annotate hl_lines="4" }
{!./docs_src/advanced/pydantic_json_type/tutorial002.py[ln:76-94]!}
Expand All @@ -57,4 +57,4 @@ After all of these actions we can change mutated model, and it will be saved to
{!./docs_src/advanced/pydantic_json_type/tutorial002.py!}
```

///
///

0 comments on commit 6b5f287

Please sign in to comment.