Open agrawal-mohit opened 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.
Hmmm... have you tried required=False? It should be the default, but I'm not sure why validation is picking that up :(
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.