heynemann / motorengine

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

ReferenceField raises InvalidDocumentError #95

Open agrawal-mohit opened 9 years ago

agrawal-mohit commented 9 years ago

class Users(Document): username = StringField(required=True) password = StringField(required=True)

class Projects(Document): name = StringField(required=True) description = StringField() created_by = ReferenceField(Users)

Error : InvalidDocumentError("Field '%s' must be valid." % name) InvalidDocumentError: Field 'created_by' must be valid.

heynemann commented 9 years ago

Hmmm... have you tried required=False? It should be the default, but I'm not sure why validation is picking that up :(