Skip to content

Commit

Permalink
Merge pull request #2 from kleschenko/patch-1
Browse files Browse the repository at this point in the history
Fix TypeError for complex types
  • Loading branch information
AntonDeMeester authored Oct 12, 2023
2 parents 244c947 + 6828d80 commit b3308d7
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions sqlmodel/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -474,6 +474,7 @@ def get_sqlalchemy_type(field: FieldInfo) -> Any:
if type2 is pydantic.AnyUrl:
meta = get_args(type_)[1]
return AutoString(length=meta.max_length)
type_ = type2
elif org_type is pydantic.AnyUrl and type(type_) is _AnnotatedAlias:
return AutoString(type_.__metadata__[0].max_length)

Expand Down

0 comments on commit b3308d7

Please sign in to comment.