This is really frustrating.
Below are my document definitions, in order to have sub-class documents inherit from a base class, I followed the suggestion here: https://groups.google.com/forum/#!topic/mongoengine-users/T8lCtGv_IYQ
models/thread.py
class Thread(object):
meta = {
'allow_inheritance': True
}
models/forum.py
from models.thread import Thread
from mongoengine import Document
class ForumThread(Document, Thread):
meta = {
'collection': 'forum_threads'
}
models/group.py
from models.thread import Thread
from mongoengine import Document
class GroupThread(Document, Thread):
meta = {
'collection': 'group_threads'
}
I am getting the NotRegistered
when attempting something of this sort;
>>> from models.forum import ForumThread
>>> print ForumThread.objects().first()
>>> NotRegistered: `Thread` has not been registered in the document registry.
Importing the document class automatically registers it, has it
been imported?
Any help/advice would be much appreciated.