Skip to content

Commit 9db90a5

Browse files
committed
fix
1 parent 47b88bf commit 9db90a5

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

sqlmodel/main.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@
7979
get_field_metadata,
8080
get_model_fields,
8181
get_relationship_to,
82+
get_sa_type_from_field,
8283
init_pydantic_private_attrs,
8384
is_field_noneable,
8485
is_table_model_class,
@@ -104,6 +105,13 @@
104105
Mapping[str, Union["IncEx", Literal[True]]],
105106
]
106107
OnDeleteType = Literal["CASCADE", "SET NULL", "RESTRICT"]
108+
SQLAlchemyConstruct = Union[
109+
hybrid_property,
110+
hybrid_method,
111+
ColumnProperty,
112+
declared_attr,
113+
AssociationProxy,
114+
]
107115

108116

109117
def __dataclass_transform__(
@@ -754,7 +762,7 @@ def get_sqlalchemy_type(field: Any) -> Any:
754762
if sa_type is not Undefined:
755763
return sa_type
756764

757-
type_ = get_type_from_field(field)
765+
type_ = get_sa_type_from_field(field)
758766
metadata = get_field_metadata(field)
759767

760768
# Check enums first as an enum can also be a str, needed by Pydantic/FastAPI

0 commit comments

Comments
 (0)