[web2py] Re: Setting up memcache on GAE - a basic question

2013-02-20 Thread Andy W
many thanks - a great help as always! Andy On Wednesday, February 20, 2013 2:43:31 AM UTC+4, howesc wrote: > > sorry about my typo. i can never remember as_dict! > > for my views i generally access the objects as dictionaries, using the > ['key'] notation. if you like you may cast the items ba

[web2py] Re: Setting up memcache on GAE - a basic question

2013-02-19 Thread howesc
sorry about my typo. i can never remember as_dict! for my views i generally access the objects as dictionaries, using the ['key'] notation. if you like you may cast the items back to web2py Storage objects, which will then have accessors like the Row object they were (Row is an extension of S

[web2py] Re: Setting up memcache on GAE - a basic question

2013-02-19 Thread Andy W
Thanks for the input. Niphlod: I tried cacheable=True but seemed to make no difference on GAE SDK Christian: adding ".as_dict()" rather than the suggested ".to_dict" on the select statement does seem to work. The caching code then becomes: students = cache.ram('students',

[web2py] Re: Setting up memcache on GAE - a basic question

2013-02-18 Thread howesc
cacheable=True is a newish option to selects right? i've not yet used itand had forgotten about it. cfh On Monday, February 18, 2013 7:17:02 AM UTC-8, Niphlod wrote: > > cacheable=True does not help ? > > On Monday, February 18, 2013 4:11:13 PM UTC+1, howesc wrote: >> >> ah yes >> >> th

[web2py] Re: Setting up memcache on GAE - a basic question

2013-02-18 Thread Niphlod
cacheable=True does not help ? On Monday, February 18, 2013 4:11:13 PM UTC+1, howesc wrote: > > ah yes > > the Rows() object returned from a select is not pickable. > > i do this a lot: > > students = cache.ram('students', > lambda:db(db.student.id>0).select(db.stud

[web2py] Re: Setting up memcache on GAE - a basic question

2013-02-18 Thread howesc
ah yes the Rows() object returned from a select is not pickable. i do this a lot: students = cache.ram('students', lambda:db(db.student.id>0).select(db.student.id, db.student.family_name, ...

[web2py] Re: Setting up memcache on GAE - a basic question

2013-02-17 Thread Andy W
Thanks for the feedback Christian. It seems to be this that causes the problem on GAE but works on sqlite: students = cache.ram('students', lambda:db(db.student.id>0).select(db.student.id, db.student.family_name,

[web2py] Re: Setting up memcache on GAE - a basic question

2013-02-17 Thread howesc
Andy, what is the object that you are trying to store in memcache? this: PicklingError: Can't pickle : attribute lookup __builtin__.function failed implies to me that you are trying to store an object that contains a function (which is not pickleable). i can't remember the exact differences,

[web2py] Re: Setting up memcache on GAE - a basic question

2013-02-16 Thread Andy W
Hi howesc The stack trace from the SDK log console is: ERROR2013-02-16 09:50:09,757 restricted.py:161] Traceback (most recent call last): File "/Users/andy/www/web2py/gluon/restricted.py", line 212, in restricted exec ccode in environment File "/Users/andy/www/web2py/applications

[web2py] Re: Setting up memcache on GAE - a basic question

2013-02-15 Thread howesc
sorry, i was unclear GAE will forcibly evict data when some unpublished limits are reached. i don't know if these limits are time or space, or a space-time continuum, but when i was storing sessions in memcache my max life was about 5 mins. On Friday, February 15, 2013 11:41:30 AM UTC-8, N

[web2py] Re: Setting up memcache on GAE - a basic question

2013-02-15 Thread Niphlod
on the "too fast eviction" issue, I remember that something was added to set the default expiration time, a time_expire parameter. On Friday, February 15, 2013 7:32:42 PM UTC+1, howesc wrote: > > i did some grepping of my code and found some things > > - it seems that cache.ram is automatica

[web2py] Re: Setting up memcache on GAE - a basic question

2013-02-15 Thread howesc
i did some grepping of my code and found some things - it seems that cache.ram is automatically set to GAE memcache when you are using GAE. it's part of the GAE setup web2py does for you. - the code above looks OK for storing sessions in memcache. FWIW, I gave up using memcache for sessi