redis should only pickle whatever it is passed along... I can review it later tonight if the latest "cache" addition broke something.
BTW: the problem with very long keys in memcache was faced before, I'm pretty sure there is some commit around 1.99.4 to fix the issue... insn't this line intended to have a smaller cache key ? http://code.google.com/p/web2py/source/browse/gluon/dal.py?name=R-1.99.4#1279 http://code.google.com/p/web2py/source/browse/gluon/dal.py#1564 On Thursday, September 13, 2012 10:58:20 AM UTC+2, rochacbruno wrote: > > Hi, > > I am here testing caching solutions, so I tried Redis and it works and it > is really fast! > > But > rows = db(query).select(cacheable=True, cache=(cache.redis, 1200)) > > when it is retrieved from redis it comes as a list > > [<Row...>, <Row...>, ] > > The only problem is that I cannot use > > rows.find(lambda row:: x) or rows.exclude(lambda row:: x) > or rows.sort(lambda row:: x) > > *Is this the behavior? if so we should put a note on book! * > > (also there is the memcache problem of keys larger than 250 chars to put a > note on book) > > <type 'exceptions.AttributeError'> 'list' object has no attribute 'find' > > 1. > 2. > > > 3. > 4. > 5. > 6. > 7. > 8. > > Traceback (most recent call last): > File "/home/bcr/projects/web2py209/gluon/restricted.py", line 209, in > restricted > > > exec ccode in environment > File > "/home/bcr/projects/web2py209/applications/menuvegano/views/gallery/app/home.html", > line 434, in <module> > > > File > "/home/bcr/projects/web2py209/applications/menuvegano/models/4_extra.py" > <http://localhost:8000/admin/default/edit/menuvegano/models/4_extra.py>, line > 153, in get_menu > > > ret = menus.find(lambda row: (row.parent == 0 or row.parent == None) and > row.visibility == visibility and row.place == place) > > AttributeError: 'list' object has no attribute 'find' > > > > > Function argument list > > (menus=[<Row {'show_order': 0, 'parent': 1, 'title': 'Co...2, 6, 3, 18, 20, > 21), 'modified_by': 1, 'id': 2}>, <Row {'show_order': 0, 'parent': 1, > 'title': 'Co...2, 6, 3, 18, 20, 41), 'modified_by': 1, 'id': 3}>, <Row > {'show_order': 0, 'parent': None, 'title': ...2, 6, 4, 19, 48, 10), > 'modified_by': 1, 'id': 1}>, <Row {'show_order': 0, 'parent': 1, 'title': > 'Pa...12, 6, 8, 6, 50, 55), 'modified_by': 1, 'id': 4}>, <Row {'show_order': > 0, 'parent': 1, 'title': 'Ne...12, 6, 8, 6, 51, 25), 'modified_by': 1, 'id': > 5}>], visibility=1, parent=None, place='top') > > > > Code listing > > > > 148. > 149. > > > 150. > 151. > 152. > 153. > > 154. > 155. > 156. > 157. > > > > def get_menu(menus, visibility=1, parent=None, place="top"): > > > ret = [] > if not parent: > > ret = menus.find(lambda row: (row.parent == 0 or row.parent == None) > and row.visibility == visibility and row.place == place) > > > else: > ret = menus.find(lambda row: row.parent == parent and row.visibility > == visibility and row.place == place) > > > return ret > > > *Bruno Cezar Rocha** - @rochacbruno* > [email protected] <javascript:> | Mobile: +55 (11) 99210-8821 > www.CursoDePython.com.br | www.rochacbruno.com.br > Blog: App news reading > (portuguese)<http://rochacbruno.com.br/app-news-reading-portuguese/> > Get a signature like this. > <http://r1.wisestamp.com/r/landing?promo=18&dest=http%3A%2F%2Fwww.wisestamp.com%2Femail-install%3Futm_source%3Dextension%26utm_medium%3Demail%26utm_campaign%3Dpromo_18> > Click > here.<http://r1.wisestamp.com/r/landing?promo=18&dest=http%3A%2F%2Fwww.wisestamp.com%2Femail-install%3Futm_source%3Dextension%26utm_medium%3Demail%26utm_campaign%3Dpromo_18> > > > --

