[google-appengine] how to get the id of key of SelfReferenceProperty

2010-07-13 Thread saintthor
class x( db.Model ): yy = db.ReferenceProperty( y ) Parent = db.SelfReferenceProperty() use yy.key().id() is ok, but Parent.key().id() is invalid. tell me SelfReferenceProperty have no attribute Key. how to get the key id then? -- You received this message because you are subscribed to

Re: [google-appengine] how to get the id of key of SelfReferenceProperty

2010-07-13 Thread Robert Kluin
SelfReferenceProperty should just return a db.Key. So assuming the property is set, normal Key methods should work. I have two suggestions: 1) Unless you are intending to dereference (ie perform another db.get()) those entities, use the get_value_for_datastore method. http://code.google.com/ap