We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent cb6ccf4 commit 4213c97Copy full SHA for 4213c97
sqlmodel/main.py
@@ -461,8 +461,11 @@ def get_sqlalchemy_type(field: FieldInfo) -> Any:
461
# UrlConstraints(max_length=512,
462
# allowed_schemes=['smb', 'ftp', 'file']) ]
463
if type_ is pydantic.AnyUrl:
464
- meta = field.metadata[0]
465
- return AutoString(length=meta.max_length)
+ if field.metadata:
+ meta = field.metadata[0]
466
+ return AutoString(length=meta.max_length)
467
+ else:
468
+ return AutoString
469
470
org_type = get_origin(type_)
471
if org_type is Annotated:
0 commit comments