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', Biography=form_biography.vars.one) biography2.put() 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.
You need to
get the entity from the datastore first. Then, you can modify the entity and
put it back into the datastore.
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. https://developers.google.com/appengine/docs/python/datastore/entities#Updating_an_Entity