[google-appengine] Re: Fetching db.Key's instead of the full data

2009-04-15 Thread 风笑雪
No you can't. The entity stores as a pair of (key: value). You can only get both of them at a same time. I suggest you use a memcache: index = memcache.get('index') if not index: index = [] result = query.fetch(15) # maybe you need do it several times index.append([e.key() for e in result])

[google-appengine] Re: Fetching db.Key's instead of the full data

2009-04-15 Thread Jeff S (Google)
Just an FYI, the ability to fetch just the keys for entities which match a query (instead of fetching the full entity) is a feature request which is on our radar. Good question, Jeff On Wed, Apr 15, 2009 at 7:57 AM, 风笑雪 wrote: > No you can't. > The entity stores as a pair of (key: value). You

[google-appengine] Re: Fetching db.Key's instead of the full data

2009-04-17 Thread mbac...@googlemail.com
Thanks Jeff. :) 风笑雪, memcache is no solution in this case, but thanks anyway. I also want to keep the overhead as low as possible, because I am already storing a lot of text data inside the datastore. Therefore I don't want to have another Kind that just handles the list of available links if th

[google-appengine] Re: Fetching db.Key's instead of the full data

2009-04-17 Thread 风笑雪
Perhaps you may keep it in another model. class BigModel(db.Model): ... class KeyModel(db.Model): key = db.ReferenceProperty(BigModel) # do below in a transaction bigEntity = BigModel() ... bigEntity.put() KeyModel(key=bigEntity.key()).put 2009/4/17 mbac...@googlemail.com > > Thanks Jeff.