I think currently there is a no "simple" way to check if the
get_or_insert() method does a "get" OR an "insert".

from google.appengine.ext import db
>>> class Pet(db.Model):
  name = db.StringProperty()

>>p = Pet.get_or_insert('titi')
>>p.is_saved()
True

The is_saved() method returns always True because get_or_insert() does
a put().

So in my example, I can check the attribute "name" for the default
value, but I think there is a missing method like "is_new()" or
something like that to check this.

Maybe I've to file a request in the issue tracker.

--~--~---------~--~----~------------~-------~--~----~
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