views:

18

answers:

1

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?

+4  A: 

Yes, you can use a SelfReferenceProperty

class SomeModel(db.Model):
    prev = db.SelfReferenceProperty()
    next = db.SelfReferenceProperty()
Adam Crossland