I've got an appengine app with two simple kinds of entities - ParentEntity
s and ChildEntity
s. Each ParentEntity
has a List
of owned ChildEntity
s.
@PersistenceCapable
public class ParentEntity
{
@PrimaryKey
@Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
private Key key;
@Persistent
private String name;
@Persistent(defaultFetchGroup=true)
private List<ChildEntity> children;
...
With ChildEntity similarly defined.
Now, I want to download all of my data from the datastore using the technique described at http://bulkloadersample.appspot.com/ . In their example they manage to export data to an xml file with owned entities nested inside parent entities. But when I try to use the following configuration (which very closely resembles theirs - see http://bulkloadersample.appspot.com/showfile/bulkloader_visitactivity.yaml and look at the activities
property), I'm met with errors.
- kind: ParentEntity
connector: simplexml
connector_options:
xpath_to_nodes: /Parents/ParentEntity
style: element_centric
property_map:
- property: __key__
external_name: key
export_transform: transform.key_id_or_name_as_string
- property: children
external_name: Children
import_transform:
transform.list_from_child_node('Children/ChildEntity')
export_transform:
transform.child_node_from_list('ChildEntity')
- kind: ChildEntity
connector: simplexml
connector_options:
xpath_to_nodes: /Children/ChildEntity
style: element_centric
property_map:
- property: __key__
external_name: key
export_transform: transform.key_id_or_name_as_string
I get the following error:
google.appengine.ext.bulkload.bulkloader_errors.ErrorOnTransform: Error on trans
form. Property: children External Name: Children. Code: transform.ch
ild_node_from_list('ChildEntity') Details: 'NoneType' object is not iterable
Big update:
I've created this sample app that you can actually view and download and test
at http://rileylark.appspot.comYou can see the output I WANT at http://rileylark.appspot.com/view
Download the eclipse project to see how it works.
What I want for my 500 points is a working config.yaml file that can export the data for Parent and ChildEntities into nested XML with appcfg.py download_data
Try using: