I started this Turial, Here
And get this error
**mongoengine.errors.NotRegistered:** `Comment` has not been registered in the document registry. Importing the document class automatically registers it, has it been imported?
any idea. Thank you So much.
Just place the Comment Model above the Post Model, since the Comment Model is being referenced in the Post Model
First register all your models some where like __init__.py file in your models package.
Then you can use get_document('Comment') function (which is imported from mongoengine.base.common) instead of importing your models in each other scripts to avoid circular imports and exceptions like mongoengine.errors.NotRegistered
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With