Change|Assign parent for the Model instance on Google App Engine Datastore
Posted
by Vladimir Prudnikov
on Stack Overflow
See other posts from Stack Overflow
or by Vladimir Prudnikov
Published on 2010-06-05T11:47:38Z
Indexed on
2010/06/05
11:52 UTC
Read the original article
Hit count: 193
Is it possible to change or assign new parent to the Model instance that already in datastore? For example I need something like this
task = db.get(db.Key(task_key))
project = db.get(db.Key(project_key))
task.parent = project
task.put()
but it doesn't works this way because task.parent
is built-in method. I was thinking about creating a new Key instance for the task but there is no way to change key as well.
Any thoughts?
© Stack Overflow or respective owner