At the moment the bulkloader does not support numeric keys as the
entity key. The main reason for this is that numeric ids are designed
to be managed by the datastore, not be user-generated. You may wish to
add an additional property to your entity kind which you can sort on.

However we are aware of this. You will need to specify a numeric key
in the transform (e.g. import_transform: lambda x:
datastore.Key.from_path(kind, int(x))). We also need to change the
bulkloader to handle both the creation of an entity with a numeric key
and more importantly figuring out how to tell the datastore's id
generation code that we've done this.

--Matthew


On May 24, 9:53 am, Craig Berry <cdbe...@gmail.com> wrote:
> Can someone help me with this, please? I'm sure the answer is trivial,
> but another weekend of tinkering hasn't led me to the solution.
>
>
>
>
>
> On Fri, May 21, 2010 at 20:21, Craig Berry <cdbe...@gmail.com> wrote:
> > I have an xml file containing data which I wish to bulkupload to GAE.
> > I am using the preview version of the new bulk uploader, if that
> > matters. How do I include an int value for the __key__ derived from a
> > field in the xml data? If I specify no import transform, like so
>
> >    - property: __key__
> >      external_name: id
> >      export_transform: transform.key_id_or_name_as_string
>
> > it loads the key as a string 'name', so it sorts lexicographically
> > rather than numerically. I want an int id instead. But I can't find
> > what to put in as an import_transform to make this happen.
>
> > Thanks in advance for any help on this.
>
> > --
> > Craig Berry -http://lapidum.org/home.html
> > "Magicians lie to the universe, and the
> > universe believes them."  -- Lenore Berry
>
> --
> Craig Berry -http://lapidum.org/home.html
> "Magicians lie to the universe, and the
> universe believes them."  -- Lenore Berry
>
> --
> You received this message because you are subscribed to the Google Groups 
> "Google App Engine for Java" group.
> To post to this group, send email to google-appengine-j...@googlegroups.com.
> To unsubscribe from this group, send email to 
> google-appengine-java+unsubscr...@googlegroups.com.
> For more options, visit this group 
> athttp://groups.google.com/group/google-appengine-java?hl=en.

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

Reply via email to