does that mean you have two of the same entry in the datastore now
though?
shouldn't you remove 'entity' after you've put it's values into
'newent'?
-akume
On Aug 14, 4:49 am, ilial <[EMAIL PROTECTED]> wrote:
> Hi,
>
> Here's my HandleEntity. Hope that helps.
>
> def HandleEntity(self, entity):
> # setup a unique key for the entity. composed of agency_name +
> reference_number
> name = entity['agency_name']+entity['reference_number']
> logging.debug("name="+name)
> newent = datastore.Entity('Contract', name=name)
> newent.update(entity)
> ent = search.SearchableEntity(newent)
> return ent
>
> On Aug 13, 9:42 pm, Angel <[EMAIL PROTECTED]> wrote:
>
> > Hi,
> > Using the bulkload_client, I found no way to set a key_name or parent
> > relation for entities. Are these features planned? Or are they already
> > in there and I am missing something. For example:
>
> > #models.py
> > class Foo(db.Model):
> > name = db.StringProperty()
>
> > class Bar(db.Model):
> > name = db.StringProperty()
> > foo = db.ReferenceProperty(Foo)
>
> > #foo.py
> > from google.appengine.ext import bulkload
> > foo = bulkload.Loader('Foo',
> > [('name',str),
> > ])
>
> > if __name__ == '__main__':
> > bulkload.main(foo)
>
> > # bar.py
> > from google.appengine.ext import bulkload
> > from models import Foo
>
> > class BarLoader(bulkload.Loader):
> > def __init__(self):
> > bulkload.Loader.__init__(self,'Bar',
> > [('name',str),
> > ('foo',str),
> > ])
> > def HandleEntity(self, entity):
> > f = Foo.all().filter("name =", entity['foo']).get()
> > entity['parent'] = f.key() # doesn't work
> > entity['key_name'] = entity['name'] # doesn't work
> > entity['foo'] = f.key() # works fine
> > return entity
> > if __name__ == '__main__':
> > bulkload.main(BarLoader())
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Google App Engine" group.
To post to this group, send email to [email protected]
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
-~----------~----~----~----~------~----~------~--~---