On Feb 19, 11:26 am, Rein Petersen <[email protected]> wrote:
>
> root() Returns a model instance for the root (top parent) entity
> within the entity chain of this instance, or None if this instance
> does not have a parent
interesting! that would definitely be useful. you don't need a
dedicated new app engine feature, though; you can do it yourself, in
user land. i haven't tested this, but it should work:
class Foo(db.Model):
...
def root_key(self):
root_key = self.parent_key()
while root_key.parent() is not None:
root_key = root_key.parent()
return root_key
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Google App Engine" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/google-appengine?hl=en
-~----------~----~----~----~------~----~------~--~---