[DOCS-5736] Comment on: "manual/tutorial/write-a-tumblelog-application-with-flask-mongoengine.txt" Created: 28/Jun/15  Updated: 03/Nov/17  Resolved: 05/Oct/16

Status: Closed
Project: Documentation
Component/s: None
Affects Version/s: None
Fix Version/s: 01112017-cleanup

Type: Bug Priority: Major - P3
Reporter: Docs Collector User (Inactive) Assignee: Unassigned
Resolution: Done Votes: 0
Labels: bite-sized
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

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


Participants:
Days since reply: 8 years, 33 weeks, 3 days ago
Story Points: 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.


Generated at Thu Feb 08 07:50:54 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.