Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ReferenceField raises InvalidDocumentError #95

Open
agrawal-mohit opened this issue Jul 10, 2015 · 1 comment
Open

ReferenceField raises InvalidDocumentError #95

agrawal-mohit opened this issue Jul 10, 2015 · 1 comment

Comments

@agrawal-mohit
Copy link

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
Copy link
Owner

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants