heynemann / motorengine

Motorengine is a port of MongoEngine for Tornado.
http://motorengine.readthedocs.org
204 stars 67 forks source link

EmbeddedDocumentField: cannot convert value of type <class '...'> to bson #132

Open dandrei opened 6 years ago

dandrei commented 6 years ago

I have the following setup:

class InnerClass(Document):
    field: StringField()

class OuterClass(Document):
    field: EmbeddedDocumentField(embedded_document_type=InnerClass)

When calling: await OuterClass(field=InnerClass(field="test")).save()

I get: cannot convert value of type <class 'scout.persist.domains.InnerClass'> to bson

What could be the problem? I followed the documentation as listed here: http://motorengine.readthedocs.io/en/latest/modeling.html