1) i don't mind removing __key__ from extra. it was just something i was using while figuring it out. (though i don't understand what it changes in how Rows is accessed).
2) The Key on GAE is a base64 encoded string of "table_name: id=<id>" (for the simple no-ancestor case). My understanding of how GAE executes the query is that it decodes the key, sorts on the numeric id, and then filters, so the transformation to the GAE Key class should not cause problems. at least that is how i understand it (and how it works in my limited usage so far). see http://code.google.com/appengine/docs/python/datastore/queriesandindexes.html#Queries_on_Keys for a little better explanation. Does that help? shall i make a new patch w/o the __key__ in _extra? thanks! christian On Jun 9, 9:08 pm, mdipierro <mdipie...@cs.depaul.edu> wrote: > The belongs is fine but I have a couple of problems: > > 1) adding __key__ in extra is not backward compatible because it > changes the way records in Rows is acceessed > > 2) if you say db(db.table.id<1000) it does not actually select records > if id<1000 but Key(id)<Key(1000). > > Did I misunderstand the source? > > On Jun 9, 10:54 pm, Christian Foster Howes <how...@umich.edu> wrote: > > > Hi all, > > > attached is a patch for gql.py. Please review and Massimo, if people > > like this, can we add it to trunk? > > > what does it do? it allows you to do key queries on Google App Engine. > > this means that you can now perform all ID queries on tables in google > > app engine. for example: > > > belongs = db(db.test_tbl.id.belongs([69126,69127])).select() > > eq = db(db.test_tbl.id==69126).select() > > neq = db(db.test_tbl.id!=69126).select() > > lt = db(db.test_tbl.id<69126).select() > > gt = db(db.test_tbl.id>69126).select() > > lte = db(db.test_tbl.id<=69126).select() > > gte = db(db.test_tbl.id>=69126).select() > > all = db(db.test_tbl.id>0).select() > > > it also adds "__key__" to _extra on each row in the result...just in > > case you really wanted to see that google key. > > > if i missed some test cases please let me know and i'll verify them as well. > > > thanks! > > > Christian > > > gql_key_query_patch.diff > > 3KViewDownload