mirror of
https://github.com/PaiGramTeam/sqlmodel.git
synced 2024-11-21 14:48:30 +00:00
support AnyURL
This commit is contained in:
parent
cb6ccf4c07
commit
4213c978fc
@ -461,8 +461,11 @@ def get_sqlalchemy_type(field: FieldInfo) -> Any:
|
||||
# UrlConstraints(max_length=512,
|
||||
# allowed_schemes=['smb', 'ftp', 'file']) ]
|
||||
if type_ is pydantic.AnyUrl:
|
||||
meta = field.metadata[0]
|
||||
return AutoString(length=meta.max_length)
|
||||
if field.metadata:
|
||||
meta = field.metadata[0]
|
||||
return AutoString(length=meta.max_length)
|
||||
else:
|
||||
return AutoString
|
||||
|
||||
org_type = get_origin(type_)
|
||||
if org_type is Annotated:
|
||||
|
Loading…
Reference in New Issue
Block a user