|
|
@ -734,11 +734,23 @@ async def solve_dependencies( |
|
|
) |
|
|
) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def _allows_none(field: ModelField) -> bool: |
|
|
if PYDANTIC_V2: |
|
|
origin = get_origin(field.type_) |
|
|
if sys.hexversion >= 0x30A00000: |
|
|
return (origin is Union or origin is types.UnionType) and type(None) in get_args( |
|
|
|
|
|
field.type_ |
|
|
def _allows_none(field: ModelField) -> bool: |
|
|
) |
|
|
origin = get_origin(field.type_) |
|
|
|
|
|
return (origin is Union or origin is types.UnionType) and type( |
|
|
|
|
|
None |
|
|
|
|
|
) in get_args(field.type_) |
|
|
|
|
|
else: |
|
|
|
|
|
|
|
|
|
|
|
def _allows_none(field: ModelField) -> bool: |
|
|
|
|
|
origin = get_origin(field.type_) |
|
|
|
|
|
return origin is Union and type(None) in get_args(field.type_) |
|
|
|
|
|
else: |
|
|
|
|
|
|
|
|
|
|
|
def _allows_none(field: ModelField) -> bool: |
|
|
|
|
|
return field.allow_none |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def _validate_value_with_model_field( |
|
|
def _validate_value_with_model_field( |
|
|
|