Thanks Nick.

If I go down the path of building ID-based URLs in the manner you
suggest, will I likely have substantially shorter URLs than I would
with str(node.key())?

Thanks,
Jeff

On Mon, Jun 15, 2009 at 4:44 AM, Nick Johnson
(Google)<nick.john...@google.com> wrote:
> Hi Jeff,
>
> You're correct that the only way to access a datastore entity is to provide
> the full path to it - the key is the entity's primary (and only) key. If you
> know the entity type of each entity in the heirarchy, though, you can
> extract the id of the entity in question and all its parents, and represent
> the ID as a delimiter-separated list of IDs, though - 1/2/3/4 - and
> regenerate the key yourself.
>
> -Nick Johnson
>
> On Sun, Jun 14, 2009 at 5:51 PM, Jeff Enderwick <jeff.enderw...@gmail.com>
> wrote:
>>
>> I have possibly deep entity groups (think tree structure), but I want
>> a URL where the user can go to a specific node, like:
>>
>> http://viewnode/<node-id>.
>>
>> I'd like to use db.get() to directly access the node rather than query
>> based on node-id.
>>
>> If I build the URL based on str(node.key()), then the strings can get
>> very big. Key.from_path() seems to want the entire path from the
>> parent. Is it really the case that the only way to get direct access
>> to an interior node in an entity group is provide the entire path to
>> that node?
>>
>> Thanks, Jeff
>>
>>
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To post to this group, send email to google-appengine@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to