From 6056755bc10fab44e5370d8513e5890899c03964 Mon Sep 17 00:00:00 2001 From: ferkans-amir Date: Mon, 27 Jul 2026 23:03:26 +0200 Subject: [PATCH] fix(main): allow bool type in Field exclude parameter type annotations --- sqlmodel/main.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sqlmodel/main.py b/sqlmodel/main.py index c551afea36..11bda69f29 100644 --- a/sqlmodel/main.py +++ b/sqlmodel/main.py @@ -243,7 +243,7 @@ def Field( serialization_alias: str | None = None, title: str | None = None, description: str | None = None, - exclude: Set[int | str] | Mapping[int | str, Any] | Any = None, + exclude: bool | Set[int | str] | Mapping[int | str, Any] | Any = None, include: Set[int | str] | Mapping[int | str, Any] | Any = None, const: bool | None = None, gt: float | None = None, @@ -286,7 +286,7 @@ def Field( serialization_alias: str | None = None, title: str | None = None, description: str | None = None, - exclude: Set[int | str] | Mapping[int | str, Any] | Any = None, + exclude: bool | Set[int | str] | Mapping[int | str, Any] | Any = None, include: Set[int | str] | Mapping[int | str, Any] | Any = None, const: bool | None = None, gt: float | None = None, @@ -338,7 +338,7 @@ def Field( serialization_alias: str | None = None, title: str | None = None, description: str | None = None, - exclude: Set[int | str] | Mapping[int | str, Any] | Any = None, + exclude: bool | Set[int | str] | Mapping[int | str, Any] | Any = None, include: Set[int | str] | Mapping[int | str, Any] | Any = None, const: bool | None = None, gt: float | None = None, @@ -371,7 +371,7 @@ def Field( serialization_alias: str | None = None, title: str | None = None, description: str | None = None, - exclude: Set[int | str] | Mapping[int | str, Any] | Any = None, + exclude: bool | Set[int | str] | Mapping[int | str, Any] | Any = None, include: Set[int | str] | Mapping[int | str, Any] | Any = None, const: bool | None = None, gt: float | None = None,