Add sa_type to Field
This commit is contained in:
parent
75ce45588b
commit
e1049fa78c
@ -372,6 +372,8 @@ class SQLModelMetaclass(ModelMetaclass, DeclarativeMeta):
|
||||
|
||||
|
||||
def get_sqlachemy_type(field: ModelField) -> Any:
|
||||
if "sa_type" in field.field_info.extra:
|
||||
return field.field_info.extra["sa_type"]
|
||||
if issubclass(field.type_, str):
|
||||
if field.field_info.max_length:
|
||||
return AutoString(length=field.field_info.max_length)
|
||||
|
Loading…
x
Reference in New Issue
Block a user