Parent resides in datastore, assign children uploaded using CSV bulkloader
Question: Presently I have a `Team` residing in the datastore:

    
    
    team = Team.get_by_key_name('Plants')
    

And I have the following CSV file in my local computer:

    
    
    name,level
    Pea Shooter,1
    Threepeater,3
    Melon-pult,20
    

My `bulkloader.yaml` looks like this:

    
    
    python_preamble:
    - import: models
    - import: my_transforms
    
    transformers:
    - kind: Character
      connector: csv
      property_map:
      - property: name
        external_name: name
    
      - property: level
        external_name: level
        import_transform: my_transforms.transform_integer
    

I wrote a `models.py` that looks like this:

    
    
    from google.appengine.ext import db
    
    class Team(db.Model):
      name = db.StringProperty()
    
    class Character(db.Model):
      name = db.StringProperty()
      level = db.IntegerProperty()
    

I also wrote a `my_transforms.py`:

    
    
    def transform_integer(integer_string):
      return int(integer_string)
    

**Question:** How do I upload the CSV file so that when the `Character`s enter
the datastore, their `parent` properties are assigned to `team`?


Answer: The first answer lacks detail but I was able to glean some information from
it.

I added another column to my CSV file named `Character.csv`:

    
    
    team,name,level
    Plants,Pea Shooter,1
    Plants,Threepeater,3
    Plants,Melon-pult,20
    

The `bulkloader.yaml` now looks like this:

    
    
    python_preamble:
    - import: models
    - import: my_transforms
    
    transformers:
    - kind: Character
      connector: csv
      property_map:
      - property: __key__
        external_name: team
        import_transform: transform.create_deep_key(('Team', 'team', False),
                                                    ('Character', 'name', False))
    
      - property: name
        external_name: name
    
      - property: level
        external_name: level
        import_transform: my_transforms.transform_integer
    

Then I do the following in the Terminal:

    
    
    $ cd /path/to/app
    $ appcfg.py upload_data --config_file=bulkloader.yaml \
                            --filename=Character.csv \
                            --kind=Character \
                            --url=http://localhost:8082/_ah/remote_api
    

