Skip to content

📝 Fix "Decimals in SQLModel" to reference Field() instead of condecimal() - #2035

Open
anxkhn wants to merge 2 commits into
fastapi:mainfrom
anxkhn:patch-1
Open

📝 Fix "Decimals in SQLModel" to reference Field() instead of condecimal()#2035
anxkhn wants to merge 2 commits into
fastapi:mainfrom
anxkhn:patch-1

Conversation

@anxkhn

@anxkhn anxkhn commented Jul 7, 2026

Copy link
Copy Markdown

Updates the Decimal documentation to match the Field() example. Closes #354.

@github-actions github-actions Bot added the docs Improvements or additions to documentation label Jul 7, 2026
@github-actions

github-actions Bot commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

📝 Docs preview

Last commit d70a7cd at: https://76173df5.sqlmodel.pages.dev

Modified Pages

@YuriiMotov

Copy link
Copy Markdown
Member

@anxkhn, the description is too verbose for such small fix..
Have you self-reviewed it before posting?

@YuriiMotov YuriiMotov changed the title docs: fix Decimal field prose to reference Field() instead of condecimal() 📝 Fix "Decimals in SQLModel" to reference Field() instead of condecimal() Jul 15, 2026

@YuriiMotov YuriiMotov left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Added alternative wording (to avoid calling Field function)

Comment thread docs/advanced/decimal.md Outdated
anxkhn added 2 commits July 27, 2026 20:01
…mal()

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 <[email protected]>
@anxkhn

anxkhn commented Jul 27, 2026

Copy link
Copy Markdown
Author

@YuriiMotov updated with your suggested wording and rebased onto current main. could you take another look when convenient?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Docs: condecimal gives type error "Illegal type annotation: call expression not allowed"

3 participants