Reputation: 6515
I tried doing the following
class SomeModel(db.Model):
prev = db.ReferenceProperty(SomeModel)
next = db.ReferenceProperty(SomeModel)
but got the following error
NameError: name 'TrackPointModel' is not defined
Is there a way of doing this?
Upvotes: 5
Views: 96
Reputation: 273
Doesn't having a, say, next property make the prev property superfluous? If I'm not mistaken this works equally well:
class SomeModel(db.Model):
next = db.SelfReferenceProperty(collection_name='prev')
Upvotes: 0
Reputation: 14213
Yes, you can use a SelfReferenceProperty
class SomeModel(db.Model):
prev = db.SelfReferenceProperty()
next = db.SelfReferenceProperty()
Upvotes: 5