mirror of
https://github.com/PaiGramTeam/sqlmodel.git
synced 2024-11-25 17:35:40 +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
|
return field.nullable
|
||||||
if not field.is_required():
|
if not field.is_required():
|
||||||
default = getattr(field, "original_default", field.default)
|
default = getattr(field, "original_default", field.default)
|
||||||
if default is None:
|
if default is PydanticUndefined:
|
||||||
return True
|
|
||||||
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