mirror of
https://github.com/PaiGramTeam/sqlmodel.git
synced 2024-11-21 22:58:22 +00:00
field required
This commit is contained in:
parent
72dc89d92b
commit
fa8955c700
@ -666,9 +666,7 @@ def _is_field_noneable(field: FieldInfo) -> bool:
|
||||
return field.nullable
|
||||
if not field.is_required():
|
||||
default = getattr(field, "original_default", field.default)
|
||||
if default is None:
|
||||
return True
|
||||
elif default is PydanticUndefined:
|
||||
if 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