Details
-
Bug
-
Resolution: Done
-
Major - P3
-
None
-
None
-
OSX 10.10.2 and Python 2.7, using the directed versions of Flask, Mongo, & MongoEngine from the tutorial install.
*Location*: http://docs.mongodb.org/manual/tutorial/write-a-tumblelog-application-with-flask-mongoengine/
*User-Agent*: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/43.0.2357.130 Safari/537.36
*Screen Resolution*: 1440 x 900
*repo*: docs
*source*: tutorial/write-a-tumblelog-application-with-flask-mongoengine
OSX 10.10.2 and Python 2.7, using the directed versions of Flask, Mongo, & MongoEngine from the tutorial install. *Location*: http://docs.mongodb.org/manual/tutorial/write-a-tumblelog-application-with-flask-mongoengine/ *User-Agent*: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/43.0.2357.130 Safari/537.36 *Screen Resolution*: 1440 x 900 *repo*: docs *source*: tutorial/write-a-tumblelog-application-with-flask-mongoengine
-
0.25
Description
Hey,
In the step where you define the schema, and set the classes for Post and Comment there's an error.
The comment class has to come before the Post class, or MongoEngine can't find it, and returns the following error:
mongoengine.errors.NotRegistered: `Comment` has not been registered in the document registry.
Importing the document class automatically registers it, has it
been imported?
If you're going to keep the structure as is, and define define Post before Comment you have to make sure you pass the name as a string (i.e., 'Comment').
I hosted a hackathon this weekend using this tutorial, and lots of beginners were stuck on this bug.