mirror of
https://github.com/PaiGramTeam/sqlmodel.git
synced 2024-11-25 09:27:40 +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)
|
default = getattr(field, "original_default", field.default)
|
||||||
if default is None:
|
if default is None:
|
||||||
return True
|
return True
|
||||||
elif default is not PydanticUndefined:
|
elif default is PydanticUndefined:
|
||||||
return False
|
return False
|
||||||
if field.annotation is None or field.annotation is NoneType:
|
if field.annotation is None or field.annotation is NoneType:
|
||||||
return True
|
return True
|
||||||
|
Loading…
Reference in New Issue
Block a user