mirror of
https://github.com/PaiGramTeam/sqlmodel.git
synced 2024-11-21 22:58:22 +00:00
field is required by default, while nullable=True for Column
This commit is contained in:
parent
6a5f373862
commit
72dc89d92b
@ -668,7 +668,7 @@ def _is_field_noneable(field: FieldInfo) -> bool:
|
||||
default = getattr(field, "original_default", field.default)
|
||||
if default is None:
|
||||
return True
|
||||
elif default is not PydanticUndefined:
|
||||
elif default is PydanticUndefined:
|
||||
return False
|
||||
if field.annotation is None or field.annotation is NoneType:
|
||||
return True
|
||||
|
Loading…
Reference in New Issue
Block a user