Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions dj_cqrs/mixins.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

from django.conf import settings
from django.db import router, transaction
from django.db.models import DateField, DateTimeField, F, IntegerField, Manager, Model
from django.db.models import DateField, DateTimeField, F, IntegerField, Manager, Model, UUIDField
from django.db.models.expressions import CombinedExpression
from django.utils.module_loading import import_string

Expand Down Expand Up @@ -261,7 +261,7 @@ def _common_serialization(self, using):
continue

value = f.value_from_object(self)
if value is not None and isinstance(f, (DateField, DateTimeField)):
if value is not None and isinstance(f, (DateField, DateTimeField, UUIDField)):
value = str(value)

data[f.name] = value
Expand Down
2 changes: 1 addition & 1 deletion tests/test_master/test_mixin.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ def test_to_cqrs_dict_basic_types():
'datetime_field': str(dt),
'float_field': 1.23,
'url_field': 'http://example.com',
'uuid_field': uid,
'uuid_field': str(uid),
}, m.to_cqrs_dict())


Expand Down