thanks for the suggestion on the ID, i'll send massimo a patch! should projection queries be automatic on GAE, or should there be a select attribute that specifies that i want a projection query? how hard should web2py work to check the validity of said query before sending to GAE?
cfh On Sunday, June 10, 2012 7:59:13 PM UTC-7, Anthony wrote: > > According to the Google docs ( > https://developers.google.com/appengine/docs/python/datastore/queries#Query_Projection), > > projection queries have the following limitations: > > > - You can only project indexed properties. This means that projecting > Text, Blob or other properties explicitly marked as unindexed is not > supported. > - You cannot project a property that also is referenced in an equality > filter. For example SELECT A FROM kind WHERE A = 1 is not supported, > but SELECT A FROM kind WHERE B = 1 or SELECT A FROM kind WHERE A > 1 is > supported. > - You cannot project the same property more than once. > - The entities returned by a projection query are only partially > populated, so they cannot be saved back to the Datastore. > > Does the new code avoid doing a projection when text or blob fields are > included and when one of the requested fields is referenced in an equality > filter? Also, should there be a way to override the projection query (right > now it looks like it's automatic whenever you request fewer than all the > fields)? > > Also, are GAE tables allowed to have id fields with names other than "id"? > If so, should line 4094 ( > http://code.google.com/p/web2py/source/browse/gluon/dal.py#4094): > > query_projection = [p for p in projection if p != 'id'] if projection \ > > be changed to something like: > > query_projection = [p for p in projection if p != self.db[tablename]._id. > name] if projection \ > > Anthony > > On Sunday, June 10, 2012 10:21:18 PM UTC-4, Massimo Di Pierro wrote: >> >> Hello Google App Engine users, >> >> Thanks to howesc we have a new feature in trunk: support for datastore >> projections. >> The problem and its solution are best explained in this post: >> >> http://stackoverflow.com/questions/10940995/does-google-app-engine-projection-queries-are-supported-by-web2py >> >> Pleas help us test it. In particular help us test trunk and make sure it >> does not break your GAE apps. >> >> Massimo >> >