mirror of
https://github.com/PaiGramTeam/sqlmodel.git
synced 2024-11-25 09:27:40 +00:00
✨ Update GUID handling to use stdlib UUID.hex
instead of an int
(#26)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
This commit is contained in:
parent
db3ad598c5
commit
5ea9340def
@ -47,10 +47,10 @@ class GUID(TypeDecorator): # type: ignore
|
||||
return str(value)
|
||||
else:
|
||||
if not isinstance(value, uuid.UUID):
|
||||
return f"{uuid.UUID(value).int:x}"
|
||||
return uuid.UUID(value).hex
|
||||
else:
|
||||
# hexstring
|
||||
return f"{value.int:x}"
|
||||
return value.hex
|
||||
|
||||
def process_result_value(self, value: Any, dialect: Dialect) -> Optional[uuid.UUID]:
|
||||
if value is None:
|
||||
|
Loading…
Reference in New Issue
Block a user