In 
http://code.google.com/appengine/docs/python/datastore/creatinggettinganddeletingdata.html#Getting_Entities_Using_a_Query,
there is a note stating that query objects have an interator
interface, and that "If the query object is used as an iterator, the
query is executed with no limit or offset, the results are loaded into
memory, and the value returned is an iterator over the results."

So no, the documentation isn't wrong, just hard to follow in some
places.




On Oct 28, 11:45 am, Michał Klich <[email protected]> wrote:
> Hi,
>
> While looking on docs for datastore at this 
> websitehttp://code.google.com/appengine/docs/python/datastore/creatinggettin...
>
> 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
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to