Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6375627
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T01:38:24+00:00 2026-05-25T01:38:24+00:00

My bulkloader.yaml looks like this: – import: models transformers: – model: models.Company connector: csv

  • 0

My bulkloader.yaml looks like this:

- import: models

transformers:
- model: models.Company
  connector: csv
  connector_options:
    encoding: utf_8
    columns: from_header
  property_map:
    - property: __key__
      external_name: companyid
      import_transform: int
      export_transform: transform.key_id_or_name_as_string

    - property: name
      external_name: name    

- model: models.Home
  connector: csv
  connector_options:
    encoding: utf_8
    columns: from_header
  property_map:
    - property: __key__
      external_name: listid
      import_transform: int
      export_transform: transform.key_id_or_name_as_string

    - property: companyid
      external_name: companyid
      import_transform: transform.create_foreign_key('Company')
      export_transform: transform.key_id_or_name_as_string    

    - property: address
      external_name: address    

- model: models.Bid
  connector: csv
  connector_options:
    encoding: utf_8
    columns: from_header
  property_map:
    - property: __key__
      external_name: listid
      import_transform: int    
      export_transform: transform.key_id_or_name_as_string

    - property: listid
      external_name: listid  
      import_transform: transform.create_foreign_key('Home',key_is_id=True)    
      export_transform: transform.key_id_or_name_as_string

    - property: bidtext
      external_name: bidtext    
      import_transform: db.Text

My models.py looks like this

from google.appengine.ext import db

# Models
class Company(db.Model):
    """Models a real estate company"""
    companyid = db.Key()
    name = db.StringProperty()

class Home(db.Model):
    """Models an apartment, house, villa etc and its selling details"""
    listid = db.Key()
    companyid = db.ReferenceProperty(Company, collection_name='company')
    address = db.StringProperty()

class Bid(db.Model):
    """Models bidding against a listid from Home model"""
    listid = db.ReferenceProperty(Home, collection_name='biddings')
    bidtext = db.TextProperty()

I have uploaded the data on my local dev server and i can view the data using http://localhost:9999/_ah/admin/datastore. So data is uploaded and exists. I see the foreign keys too.

I am not able to access child data based on parent object. It returns empty. Below pasted is what i have been executing in interactive console on local dev datastore:

from google.appengine.ext import db
from models import Home,Bid,Company

#can access parent data from child i.e. Home
bd = Bid.get_by_id(4242)
hhh =  Home.get_by_id(int(bd._listid.name()))
print hhh.state

#Again, can access parent data from child i.e. Company
h = Home.get_by_id(4242)
print h.address
c = Company.get_by_id(int(h._companyid.name()))
print c.website

#Cannot find any data here (biddings is a collection name defined in Bid model)
b = Bid.gql("WHERE listid = :1", h)
for x in h.biddings:
    print x.bidtext

Output:

London
Riverview 24,
http://www.houses.com/
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T01:38:26+00:00Added an answer on May 25, 2026 at 1:38 am

    Alright I found what i was doing wrong.
    In my bulkloader.yaml, i was referencing entities as models instead of kind.

    Once i used

    - kind: Home
    

    instead of

    - model: models.Home
    

    Also i used key_is_id=True at both the foreign key references to solve the problem of finding parent and child data.

    Now this is how i access my parent and child data

    from google.appengine.ext import db
    from models import Home,Bid,Company
    
    #get home object
    h = Home.get_by_id(4242)
    print h.address
    
    #get parent values
    print h.companyid.website
    
    #get child values
    b = Bid.gql("WHERE listid = :1", h.key())
    for xb in b:
        print xb.bidtext
    

    I hope this helps some noob like me cause i wasted a lot of time behind this.
    Thank you everyone who took time to respond to this thread.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

bulkoader.yaml: transformers: - kind: ExampleModel connector: csv property_map: - property: __key__ external_name: key export_transform:
in the default bulkloader.yaml it said this: # - Check that __key__ property is
I'm trying to populate a db.ListProperty() model field using bulkloader. I'm using an import
I ran bulkloader with parameters to export my bigtable to a csv file, and
I want to use bulkloader to download all entities in a model with some
I have a model in App Engine that I am exporting in CSV format
I have a 'College' model data. My str_loader.py is: class MySQLExporter(bulkloader.Exporter): def output_entities(self, entity_generator):
From an empty datastore, I was able to auto-generate a bulkloader.yaml file. It only
In short: how can I configure bulkloader to insert data into 2 models with
Bulkloader raises the following error when importing a CSV file with large cells: [ERROR

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.