Skip to content

Commit 884053d

Browse files
committed
docs: fix Decimal field prose to reference Field() instead of condecimal()
The 'Decimals in SQLModel' section introduced its example with 'using the condecimal() function', but the example (and current SQLModel) uses Field(max_digits=..., decimal_places=...). condecimal() is a Pydantic v1 constrained-type helper that SQLModel does not re-export, and using it as an annotation trips static type checkers. Reword the sentence to match the paragraph above it and the code sample, both of which already use Field(). Signed-off-by: Anas Khan <83116240+anxkhn@users.noreply.github.com>
1 parent 07b69be commit 884053d

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

docs/advanced/decimal.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ For the database, **SQLModel** will use [SQLAlchemy's `DECIMAL` type](https://do
3131

3232
## Decimals in SQLModel
3333

34-
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:
34+
Let's say that each hero in the database will have an amount of money. We could make that field a `Decimal` type and set the number of digits and decimal places in the `Field()` function:
3535

3636
{* ./docs_src/advanced/decimal/tutorial001_py310.py ln[1:11] hl[11] *}
3737

0 commit comments

Comments
 (0)