Hi,

I have a few objects put together in an entity group because they are
needed in a transaction.
These objects also have a key_name, set during creation. I want to
retrieve then with the
Model.get_by_key_name() function, and not with a GQL query.

The problem is that Model.get_by_key_name() can't find them by key_name.

After some experimentation I found when they are found, and now very
carefully read the manual for get_by_key_name().
You have to know which object is the parent of the object you look for
with the given key_name.
So, get the parent by key_name. And use the parent object to get the
one you want
Model.get_by_key_name(keyName, parent=parentObject).

But if the direct parent is not a root node you have to get his parent
too before you can get the direct parent.
You have to do it all the way to the root tree?
Or is it enough to get the root node of the entity group and use that
as a parent node in the calls to get_by_key_name() for the object in
the entity group?

In short the key_name of an object IS the path, series of
keys/IDs/key_names of all the parents of the object, followed by the
key_name you supply in the constructor.

Both data viewers, develop and production, don't show this
long-key_name. Not at all in list of objects of a certain kind, the
development data viewer shows that the entity has a parent node, the
production data viewer does NOT show a possible parent object.

It would be much more clear if the key_name that you specify in the
constructor is unique "as given".
And if you want to, you can specify a path like
"root_key/object1_key/object2_key/this_key".

Djidjadji

--~--~---------~--~----~------------~-------~--~----~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to