Thanks for the heads up on that interesting method.

Just wondering, from your comment in the other thread:

"Or, stick with the lexical path but use the full byte rather than
decimal to store the number.. then just 2 bytes give you a max of 64k
comments per depth and 200+ deep. "

The sort order for StringProperty is in Unicode, so wouldn't you have
to use
an something like UTF-8?


Some pros of this method:
- Fast query for children
- Possible to reconstruct hierarchy

Cons:
- Limited depth
- Need to do query for siblings before setting the path
- Somewhat complex.  Need to increment Unicode character



On Oct 31, 3:34 am, Anthony <[EMAIL PROTECTED]> wrote:
> Store all the parent ids as a hierarchy in a string...
>
> h="id1/id2/"
> h="id1/id2/id3"
> h="id1/id2/id3/id4"
> h="id5/"
> h="id5/id6"
>
> You can then filter WHERE h > "id1/" and h < "id5/" to get all
> children of id1.
>
> Or you can use entity groups & ancestors.
>
> More details 
> here...http://groups.google.com/group/google-appengine/browse_thread/thread/...
>
> On Oct 31, 8:31 am, Chris Tan <[EMAIL PROTECTED]> wrote:
>
> > I'm wondering how other people have been modeling hierarchical
> > information
> > such as nested comments.
>
> > My first thought was to do something like this:
>
> > class Comment(db.Model):
> >     reply_to = db.SelfReferenceProperty(collection_name="replies")
> >     author = db.UserProperty()
> >     content = db.TextProperty()
>
> > However, this isn't scalable, as a query is made for every
> > comment in the thread.
>
> > Any ideas?
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to