You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am trying to set an EmbeddedDocument as a value in a DictField, which according to #99 should work. However, when I do so, I receive the following error:
bson.errors.InvalidDocument: cannot encode object: <object EmbeddedDocument objects.items.MockItem({'uuid': UUID('cee1f505-1014-4bc8-9095-7047c869587c'), '_token_id': '1583', 'durability': 100})>, of type: <Implementation class 'objects.items.MockItem'>
The DictField's definition:
_slots=fields.DictField(attribute="slots")
The MockItemEmbeddedDocument:
instance.registerclassMockItem(EmbeddedDocument):
"""An item with associated durability."""uuid=fields.UUIDField(default=uuid.uuid4)
_token_id=fields.StrField(required=True, attribute="tokenId")
durability=fields.IntField(default=100)
_item=None# Custom __getattr__ and __hash__ omitted
Stepping through the debugger, prior to attempting to commit(), the _slots dict has the following value:
In my AsyncioMotorClient, I am setting uuidRepresentation="standard", but I get the error with or without the UUID field present. What am I doing wrong?
The text was updated successfully, but these errors were encountered:
I am trying to set an
EmbeddedDocument
as a value in aDictField
, which according to #99 should work. However, when I do so, I receive the following error:The
DictField
's definition:The
MockItem
EmbeddedDocument
:Stepping through the debugger, prior to attempting to
commit()
, the_slots
dict has the following value:In my
AsyncioMotorClient
, I am settinguuidRepresentation="standard"
, but I get the error with or without the UUID field present. What am I doing wrong?The text was updated successfully, but these errors were encountered: