diff --git a/xmodel/converters.py b/xmodel/converters.py index 4660e86..40b8e31 100644 --- a/xmodel/converters.py +++ b/xmodel/converters.py @@ -1,3 +1,5 @@ +import uuid + import ciso8601 from xmodel.base.fields import Converter, Field @@ -255,4 +257,5 @@ def convert_decimal( float: ConvertBasicType(basic_type=float), str: ConvertBasicType(basic_type=str), bool: ConvertBasicBool(), + uuid.UUID: ConvertBasicType(basic_type=str), } diff --git a/xmodel/remote/api.py b/xmodel/remote/api.py index 8df4169..cbc2e2c 100644 --- a/xmodel/remote/api.py +++ b/xmodel/remote/api.py @@ -1,4 +1,5 @@ import dataclasses +import uuid from decimal import Decimal from logging import getLogger from typing import ( @@ -242,7 +243,7 @@ def get_via_id( value_type = type(id) # Treat a Decimal as a string for the purposes of querying for it. - if type(id) is Decimal: + if type(id) in (Decimal, uuid.UUID): id = str(id) value_type = str