Hi Michal, You're quite right - the example code there will not correctly update the existing records. Would you be able to file a documentation bug, please?
-Nick Johnson 2009/10/28 Michał Klich <[email protected]> > Hi, > > While looking on docs for datastore at this website > > http://code.google.com/appengine/docs/python/datastore/creatinggettinganddeletingdata.html > > I found code: > > if users.get_current_user(): > user_pets = db.GqlQuery("SELECT * FROM Pet WHERE owner = :1", > users.get_current_user()) > for pet in user_pets: > pet.spayed_or_neutered = True > > db.put(user_pets) > > Correct me if i am wrong but should not be it like: > > if users.get_current_user(): > user_pets = db.GqlQuery("SELECT * FROM Pet WHERE owner = :1", > users.get_current_user()) > results = user_pets.fetch(10) > > for pet in results: > pet.spayed_or_neutered = True > > db.put(results) > > I could not make it to work in original version but mnaybe i am wrong, i > spent way too much time on this trying to figure it out. > > -- > Michał Klich > > [email protected] > [email protected] > http://www.michalklich.com > > > > > -- Nick Johnson, Developer Programs Engineer, App Engine Google Ireland Ltd. :: Registered in Dublin, Ireland, Registration Number: 368047 --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
