I am missing the point. Caching in DB?
On Feb 7, 11:40 am, Robin B <[email protected]> wrote:
> And what about this:
>
> dal = DAL()
> dal.define_database('fsdb','filesystem')
> dal.define_database('memdb','memcache')
> dal.define_database('ramdb','dict')
>
> cache.mem = CacheClient(db=dal.memdb)
> cache.ram = CacheClient(db=dal.ramdb)
> cache.disk = CacheClient(db=dal.fsdb)
>
> @cache(request.env.path_info,time_expire=5,cache_model=cache.mem)
> def cache_controller_in_ram():
> import time
> t=time.ctime()
> return dict(time=t,link=A('click me',_href=URL(r=request)))
>
> Robin
>
> On Feb 7, 11:25 am, Robin B <[email protected]> wrote:
>
> > I am implementing the joins on GAE, and I realized that you should be
> > able to perform joins between DAL databases whether it is the same
> > driver or not.
>
> > fsdb = FSDB(...,name='fsdb')
> > gaedb = GAEDB(...,name='gaedb')
>
> > rows = ((gaedb.users.name=='bob')&
> > (gaedb.users.id==fsdb.users.id)).select(fsdb.users.data)
>
> > rows[0].fsdb.users.data
>
> > This should would work for FSDB, DICTDB, and also any API that can be
> > abstracted as a DAL (eg. MEMDB, ...).
>
> > Robin
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"web2py Web Framework" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/web2py?hl=en
-~----------~----~----~----~------~----~------~--~---