Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

python google appengine db.Model add a parent after instance has been constructed

I have some models in my datastore and I wanted to add in a parent relationship as described by the parent keyword in the constructor on this page:

http://code.google.com/appengine/docs/python/datastore/modelclass.html

Is this possible and if so, what would be the cleanest way to do it?

Thanks

like image 519
probably at the beach Avatar asked Apr 19 '26 21:04

probably at the beach


1 Answers

You can't; the parent's key path is part of the entity's key, which can't be changed after the entity is in the datastore. You'll need to create a new entity with the same data and the new parent and delete the original entity.

like image 153
Wooble Avatar answered Apr 21 '26 10:04

Wooble



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!