I personally hate it when I have to do double puts, especially double puts 
with no other RPC in between.  Allocating ids for keys is an RPC call too, 
but it would probably end up being faster.

Also, you can create a unique key for an object using uuid.uuid4().  

key = db.Key.from_path('Session', uuid.uuid4().bytes.encode('hex'))


This ends up being a win/lose because it doesn't require an RPC to generate, 
but winds up creating a larger key (more index space, yada, yada).  I 
usually use this when I'm going to be using the key name/id in a user-facing 
request, because I'm paranoid about sending easy to guess values to users.

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To post to this group, send email to google-appengine@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en.

Reply via email to