diff --git a/sqlmodel/main.py b/sqlmodel/main.py index ab41b7b..fc99f00 100644 --- a/sqlmodel/main.py +++ b/sqlmodel/main.py @@ -524,6 +524,8 @@ def get_column_from_field(field: FieldInfo) -> Column: # type: ignore return sa_column if isinstance(sa_column, MappedColumn): return sa_column.column + if isinstance(sa_column, types.FunctionType): + return sa_column() sa_type = get_sqlalchemy_type(field) primary_key = getattr(field, "primary_key", False) index = getattr(field, "index", PydanticUndefined)