iceanfire wrote:
> I've got Model_C which is the child of Model_P. In this case, there
> are about 200 Model_P entities with each one having one child. When I
> took a look at data viewer, I noticed that all Model_C entities had an
> id of "1". Is this something that only occurs for parent/child
> relationships? Or should I not rely on IDs to be unique within a Model
> that doesn't have parents?

Keys are only unique in the "fully qualified" form.  The fully
qualified key for an entity is like a tuple consisting of the app
name, the kind name and key name/id of the entity's ancestors, if any,
and the kind name of key name/id of the entity itself.  So for your
app the unique keys would be something like:

    ("appname", "Model_P", 1, "Model_C", 1)
    ("appname", "Model_P", 2, "Model_C", 1)
    ...
    ("appname", "Model_P", 199, "Model_C", 1)
    ("appname", "Model_P", 200, "Model_C", 1)

The Google App Engine documentation puts it like this:

    The complete key of an entity, including the path, the kind and
    the name or numeric ID, is unique and specific to that entity. The
    complete key is assigned when the entity is created in the
    datastore, and none of its parts can change.

    The keys of two different entities can have similar parts as long
    as at least one part is different. For instance, two entities can
    have the same kind and name if they have different
    parents. Similarly, two entities can have the same parent (or no
    parent) and name if they are of different kinds

                                  Ross Ridge

--~--~---------~--~----~------------~-------~--~----~
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