Skip to content

Commit ab965f0

Browse files
authored
Merge branch 'main' into sqlalchemy_polymorphic_support
2 parents 525373d + 7d00768 commit ab965f0

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+227
-10667
lines changed

.github/workflows/build-docs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ jobs:
5959
with:
6060
python-version: "3.11"
6161
- name: Setup uv
62-
uses: astral-sh/setup-uv@v4
62+
uses: astral-sh/setup-uv@v5
6363
with:
6464
version: "0.4.15"
6565
enable-cache: true

.github/workflows/deploy-docs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ jobs:
2929
with:
3030
python-version: "3.11"
3131
- name: Setup uv
32-
uses: astral-sh/setup-uv@v4
32+
uses: astral-sh/setup-uv@v5
3333
with:
3434
version: "0.4.15"
3535
enable-cache: true

.github/workflows/smokeshow.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
with:
2222
python-version: '3.9'
2323
- name: Setup uv
24-
uses: astral-sh/setup-uv@v4
24+
uses: astral-sh/setup-uv@v5
2525
with:
2626
version: "0.4.15"
2727
enable-cache: true

.github/workflows/test.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ jobs:
4444
with:
4545
python-version: ${{ matrix.python-version }}
4646
- name: Setup uv
47-
uses: astral-sh/setup-uv@v4
47+
uses: astral-sh/setup-uv@v5
4848
with:
4949
version: "0.4.15"
5050
enable-cache: true
@@ -92,7 +92,7 @@ jobs:
9292
with:
9393
python-version: '3.12'
9494
- name: Setup uv
95-
uses: astral-sh/setup-uv@v4
95+
uses: astral-sh/setup-uv@v5
9696
with:
9797
version: "0.4.15"
9898
enable-cache: true

docs/advanced/decimal.md

Lines changed: 3 additions & 125 deletions
Original file line numberDiff line numberDiff line change
@@ -33,45 +33,7 @@ For the database, **SQLModel** will use <a href="https://docs.sqlalchemy.org/en/
3333

3434
Let's say that each hero in the database will have an amount of money. We could make that field a `Decimal` type using the `condecimal()` function:
3535

36-
//// tab | Python 3.10+
37-
38-
```python hl_lines="11"
39-
{!./docs_src/advanced/decimal/tutorial001_py310.py[ln:1-11]!}
40-
41-
# More code here later 👇
42-
```
43-
44-
////
45-
46-
//// tab | Python 3.7+
47-
48-
```python hl_lines="12"
49-
{!./docs_src/advanced/decimal/tutorial001.py[ln:1-12]!}
50-
51-
# More code here later 👇
52-
```
53-
54-
////
55-
56-
/// details | 👀 Full file preview
57-
58-
//// tab | Python 3.10+
59-
60-
```Python
61-
{!./docs_src/advanced/decimal/tutorial001_py310.py!}
62-
```
63-
64-
////
65-
66-
//// tab | Python 3.7+
67-
68-
```Python
69-
{!./docs_src/advanced/decimal/tutorial001.py!}
70-
```
71-
72-
////
73-
74-
///
36+
{* ./docs_src/advanced/decimal/tutorial001_py310.py ln[1:11] hl[11] *}
7537

7638
Here we are saying that `money` can have at most `5` digits with `max_digits`, **this includes the integers** (to the left of the decimal dot) **and the decimals** (to the right of the decimal dot).
7739

@@ -105,97 +67,13 @@ Make sure you adjust the number of digits and decimal places for your own needs,
10567

10668
When creating new models you can actually pass normal (`float`) numbers, Pydantic will automatically convert them to `Decimal` types, and **SQLModel** will store them as `Decimal` types in the database (using SQLAlchemy).
10769

108-
//// tab | Python 3.10+
109-
110-
```Python hl_lines="4-6"
111-
# Code above omitted 👆
112-
113-
{!./docs_src/advanced/decimal/tutorial001_py310.py[ln:24-34]!}
114-
115-
# Code below omitted 👇
116-
```
117-
118-
////
119-
120-
//// tab | Python 3.7+
121-
122-
```Python hl_lines="4-6"
123-
# Code above omitted 👆
124-
125-
{!./docs_src/advanced/decimal/tutorial001.py[ln:25-35]!}
126-
127-
# Code below omitted 👇
128-
```
129-
130-
////
131-
132-
/// details | 👀 Full file preview
133-
134-
//// tab | Python 3.10+
135-
136-
```Python
137-
{!./docs_src/advanced/decimal/tutorial001_py310.py!}
138-
```
139-
140-
////
141-
142-
//// tab | Python 3.7+
143-
144-
```Python
145-
{!./docs_src/advanced/decimal/tutorial001.py!}
146-
```
147-
148-
////
149-
150-
///
70+
{* ./docs_src/advanced/decimal/tutorial001_py310.py ln[24:34] hl[25:27] *}
15171

15272
## Select Decimal data
15373

15474
Then, when working with Decimal types, you can confirm that they indeed avoid those rounding errors from floats:
15575

156-
//// tab | Python 3.10+
157-
158-
```Python hl_lines="15-16"
159-
# Code above omitted 👆
160-
161-
{!./docs_src/advanced/decimal/tutorial001_py310.py[ln:37-50]!}
162-
163-
# Code below omitted 👇
164-
```
165-
166-
////
167-
168-
//// tab | Python 3.7+
169-
170-
```Python hl_lines="15-16"
171-
# Code above omitted 👆
172-
173-
{!./docs_src/advanced/decimal/tutorial001.py[ln:38-51]!}
174-
175-
# Code below omitted 👇
176-
```
177-
178-
////
179-
180-
/// details | 👀 Full file preview
181-
182-
//// tab | Python 3.10+
183-
184-
```Python
185-
{!./docs_src/advanced/decimal/tutorial001_py310.py!}
186-
```
187-
188-
////
189-
190-
//// tab | Python 3.7+
191-
192-
```Python
193-
{!./docs_src/advanced/decimal/tutorial001.py!}
194-
```
195-
196-
////
197-
198-
///
76+
{* ./docs_src/advanced/decimal/tutorial001_py310.py ln[37:50] hl[49:50] *}
19977

20078
## Review the results
20179

docs/release-notes.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@
88

99
### Docs
1010

11+
* ✏️ Fix typo in `docs/tutorial/create-db-and-table.md`. PR [#1252](https://github.com/fastapi/sqlmodel/pull/1252) by [@ArianHamdi](https://github.com/ArianHamdi).
12+
* ✏️ Fix typo in `insert.md`. PR [#1256](https://github.com/fastapi/sqlmodel/pull/1256) by [@Noushadaliam](https://github.com/Noushadaliam).
13+
* 📝 Update markdown includes format. PR [#1254](https://github.com/fastapi/sqlmodel/pull/1254) by [@tiangolo](https://github.com/tiangolo).
14+
* 📝 Update fenced code in Decimal docs for consistency. PR [#1251](https://github.com/fastapi/sqlmodel/pull/1251) by [@tiangolo](https://github.com/tiangolo).
1115
* ✏️ Fix typo in the release notes of v0.0.22. PR [#1195](https://github.com/fastapi/sqlmodel/pull/1195) by [@PipeKnight](https://github.com/PipeKnight).
1216
* 📝 Update includes for `docs/advanced/uuid.md`. PR [#1151](https://github.com/fastapi/sqlmodel/pull/1151) by [@tiangolo](https://github.com/tiangolo).
1317
* 📝 Update includes for `docs/tutorial/create-db-and-table.md`. PR [#1149](https://github.com/fastapi/sqlmodel/pull/1149) by [@tiangolo](https://github.com/tiangolo).
@@ -17,6 +21,8 @@
1721

1822
### Internal
1923

24+
* ⬆ Bump astral-sh/setup-uv from 4 to 5. PR [#1249](https://github.com/fastapi/sqlmodel/pull/1249) by [@dependabot[bot]](https://github.com/apps/dependabot).
25+
* ⬆ Bump pillow from 10.3.0 to 11.0.0. PR [#1139](https://github.com/fastapi/sqlmodel/pull/1139) by [@dependabot[bot]](https://github.com/apps/dependabot).
2026
* ⬆ Bump pypa/gh-action-pypi-publish from 1.9.0 to 1.12.3. PR [#1240](https://github.com/fastapi/sqlmodel/pull/1240) by [@dependabot[bot]](https://github.com/apps/dependabot).
2127
* ⬆ Bump astral-sh/setup-uv from 3 to 4. PR [#1225](https://github.com/fastapi/sqlmodel/pull/1225) by [@dependabot[bot]](https://github.com/apps/dependabot).
2228
* ⬆ Bump tiangolo/latest-changes from 0.3.1 to 0.3.2. PR [#1207](https://github.com/fastapi/sqlmodel/pull/1207) by [@dependabot[bot]](https://github.com/apps/dependabot).

0 commit comments

Comments
 (0)