From 728c160b50112b6cd522ecddbe409b3d08ea7805 Mon Sep 17 00:00:00 2001 From: mark-todd <60781787+mark-todd@users.noreply.github.com> Date: Fri, 25 Jun 2021 15:45:31 +0100 Subject: [PATCH] Added python_type into GUID (#648) --- fastapi_users/db/sqlalchemy.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/fastapi_users/db/sqlalchemy.py b/fastapi_users/db/sqlalchemy.py index fd832436..e5ec0270 100644 --- a/fastapi_users/db/sqlalchemy.py +++ b/fastapi_users/db/sqlalchemy.py @@ -18,8 +18,10 @@ class GUID(TypeDecorator): # pragma: no cover Uses PostgreSQL's UUID type, otherwise uses CHAR(36), storing as regular strings. """ + class UUIDChar(CHAR): + python_type = UUID4 - impl = CHAR + impl = UUIDChar def load_dialect_impl(self, dialect): if dialect.name == "postgresql":