can i select a name for a key when using ndb?

87 views
Skip to first unread message

saintthor

unread,
Jun 16, 2012, 12:55:36 PM6/16/12
to google-a...@googlegroups.com
for db.expando E:

E( key_name = 'zzz' ).put()

will create an entity with a key named 'zzz'. but when using ndb.expando, it set an attribute named 'key_name ' with the value 'zzz'.

how to make the ndb work as db?

Guido van Rossum

unread,
Jun 16, 2012, 4:26:50 PM6/16/12
to google-a...@googlegroups.com
Use E(id='zzz').put()

--Guido van Rossum 

saintthor

unread,
Jun 17, 2012, 10:41:14 PM6/17/12
to google-a...@googlegroups.com
thank you.

and, how to select all of the keys in one Model?

在 2012年6月17日星期日UTC+8上午4时26分50秒,Guido van Rossum写道:
Reply all
Reply to author
Forward
0 new messages