I have a mongoengine.Document subclass User defined.
class User(Document):
meta = {'collection': 'users', 'allow_inheritance': False}
_id = ObjectIdField()
password = StringField(max_length=50)
name = StringField(max_length=50, required
now i want to use it as standalone document with its own collection but i want also to use it as EmbeddedDocument as part of Game record:
class Game(Document):
meta = {'collection': 'games', 'allow_inheritance': False}
_id = ObjectIdField()
name = StringField()
owner = EmbeddedField(User)
but there is a problem. Mongoengine allows to embed only EmbeddedDocument subclasses. Is there a way to solve it?