[web2py] Re: DAL level access to GAE entities by named key

2011-10-17 Thread Wikus van de Merwe
Thanks! It works with the query using the "long" syntax: *db(db.table_name.id == key).select().first()* The short version *db.table_name(key)* does returns *None* as it performs a check if key is an integer first. However, using a query instead of a key also works: *db.table_name(db.table_name.i

[web2py] Re: DAL level access to GAE entities by named key

2011-10-16 Thread Murray3
yeh..sorry, i worked that out after I sent post. thanks for this again. On Oct 16, 4:58 pm, howesc wrote: > is this the line that is failing: > >     #this fails, unknown key exception >     entity_keyid = db.funtest[key] > > i meant to comment it out in my example since it fails.

[web2py] Re: DAL level access to GAE entities by named key

2011-10-16 Thread howesc
is this the line that is failing: #this fails, unknown key exception entity_keyid = db.funtest[key] i meant to comment it out in my example since it fails.

[web2py] Re: DAL level access to GAE entities by named key

2011-10-16 Thread Murray3
Christian, Itried this in the gae sdk development console and replaced args with a string as request not available and its just a quick test. I copied the dal.py from trunk and replaced into my copy of last stable release I get there traceback listed below #the code in dev console-- from g

[web2py] Re: DAL level access to GAE entities by named key

2011-10-15 Thread Massimo Di Pierro
pushing to trunk On Oct 15, 11:01 am, howesc wrote: > groups wouldn't let me attache a file.  here's the text: > > diff -r 57544ce34efe gluon/dal.py > --- a/gluon/dal.py      Wed Oct 12 21:53:13 2011 -0500 > +++ b/gluon/dal.py      Sat Oct 15 08:54:00 2011 -0700 > @@ -3385,7 +3385,7 @@ >        

[web2py] Re: DAL level access to GAE entities by named key

2011-10-15 Thread howesc
groups wouldn't let me attache a file. here's the text: diff -r 57544ce34efe gluon/dal.py --- a/gluon/dal.py Wed Oct 12 21:53:13 2011 -0500 +++ b/gluon/dal.py Sat Oct 15 08:54:00 2011 -0700 @@ -3385,7 +3385,7 @@ (items, tablename, fields) = self.select_raw(query,fields,attribu

[web2py] Re: DAL level access to GAE entities by named key

2011-10-15 Thread howesc
I finally got back to this. using web2py trunk there was a minor modification to dal.py in the attached patch to make the following example work: db.define_table('funtest', Field('name', length=128)) def create_one(): id = request.args[0] from google.appengine.ext import

[web2py] Re: DAL level access to GAE entities by named key

2011-10-15 Thread Murray3
It would be great if (when the code is fully tested) some full example code for getting this working was posted / made available. It would be a much welcome addition to the greatly improved (and ongoing :) documentation done on web2py over the last year. cjm On Oct 12, 6:03 pm, howesc wrote: > i

[web2py] Re: DAL level access to GAE entities by named key

2011-10-12 Thread howesc
i know we went back and forth a few months back and i helped with the patch for it, but it was lightly tested and i never used it myself in a production environment. i suspect it's a simple fix and i'll take a look at the DAL as well. cfh

[web2py] Re: DAL level access to GAE entities by named key

2011-10-11 Thread Wikus van de Merwe
I'm getting nothing (None). If the intention was to having it work this way (by passing key as id) I'll have a look at the DAL code more closely. Maybe something affects the key outside of the select_raw function. Have this ever worked for you?

[web2py] Re: DAL level access to GAE entities by named key

2011-10-11 Thread howesc
i am under the belief that while undocumented it should work and most likely can be fixed. are you getting an error, or just nothing in the result?