Hello Cosmin. Your code at line 22 behaves as expected, retrieving the last 
value that was saved to the Datastore, that last value being one. When you 
set "nr" to 10 on line 21 you're only affecting the local copy of the model 
and the changes won't be reflected to the datastore until you perform 
another put operation on this entity.

Regarding the ID of Datastore entities, refer to this documentation 
<https://cloud.google.com/appengine/docs/standard/python/ndb/creating-entity-keys>
 to 
learn how to specify your own, if that's what you want to do.


On Wednesday, June 7, 2017 at 9:57:57 AM UTC-4, Cosmin Poieană wrote:
>
> I have this code here: http://sprunge.us/TAjH?py
>
> Why am I getting 10 instead of 1 (or what is in the DB)? Also, any new 
> retrieved python object (as entity) has the very same ID (and maybe even 
> memory address). Why that? How should I proceed in order to have different 
> objects with the real value stored under the DB?
>

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/google-appengine.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-appengine/0779e78d-12f0-4baf-9c2e-7ebce3a7c64a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
  • [google-appengine... Cosmin Poieană
    • [google-appe... 'Yannick (Cloud Platform Support)' via Google App Engine

Reply via email to