Given the following Code:
from mongoengine import *
connect('spike_bidirectional')
class User(Document):
name = StringField()
page = ListField(ReferenceField('Page'))
class Page(Document):
content = StringField()
user = ReferenceField(User)
u = User(name="Test User").save()
p = Page(content="Page 1", user=u).save()
p2 = Page(content="Page 2", user=u).save()
u.reload()
p.reload()
x = u.pages
x is always empty. The Database itself looks pretty well. Is there a way to access all Pages related to a userobject directly from the user?
If Bidirectional connections are possible i wonder what the rules are to define the owning and the referenced site in the datamodel. Are the names of the attribute itself relevant?