since four days I’m trying to figure out how to follow a reference from one to another class, starting from the class which is beeing referenced. In SQL-Django there is a related_name to achieve this…
For example I have this class:
class MyClass(Document):
...
other_classes = ListField(ReferenceField(Other_Class))
and this one:
class Other_Class(Document):
...
Now I want to go from Other_Class to MyClass… Any ideas?
Thanks,
Ron
Here is a test case showing how to query it:
The main question is do you need to store a list of references in the
MyClass? It might be more efficient to store the relationship just onOtherClass..