inserting data into google app engine datastore

Go To


The Google_App-Engine erases everything in my table using the put statement. I don't want it to do that, it makes for more code to have to re.put everything back in the table, every time something is added.

Basically the issue is that the put statement erases everything. is there a way to save what I don't want to update?

here is the code: ((python web2py))

biography2 = bayside(key_name='bayside',
redirect(URL("b1", "bayside"))

the put statement, will update the biography under the table bayside, but it erases everything else in that table (genre, songs, etc...) I want it to keep the other table elements and only update the biography. Is that possible? Right now I have had to resort to hack that updates all table elements when I really just want to update one. it is very frustrating, and makes for a ton of extra code.

2012-04-04 00:05
by Chris Hawkes
you need to show the code that is failing - aschmid00 2012-04-04 00:38


You need to get the entity from the datastore first. Then, you can modify the entity and put it back into the datastore.

2012-04-04 00:51
by Adam Crossland
thank you, thank you, thank yo - Chris Hawkes 2012-04-04 01:10


to me it looks like you are overwriting an existing entity instead of getting and updating properties of an existing one. you should take a look at the docs.

2012-04-04 00:51
by aschmid00