After pycon. ;-)

On Feb 27, 4:04 pm, Markus Gritsch <m.grit...@gmail.com> wrote:
> Hi,
>
> any plans to implement the 'prefix' argument mentioned below?  It
> could be used to prevent from accidentally using the same tables by
> different applications on GAE?
>
> Markus
>
> On 7 Feb., 23:56, mdipierro <mdipie...@cs.depaul.edu> wrote:
>
> > This is an un-necessary complication.
>
> > I think all we need (eventually) is
>
> > db=DB('postgresq://...',pools=20,prefix='xxx')
>
> > so that db.define_table('table',....) translates into 'CREATETABLE
> > xxx_table'. This is not so easy to implement.
>
> > On Feb 7, 12:03 pm, Robin B <robi...@gmail.com> wrote:
>
> > > Namespaces can also be generalized by unifying under the DAL:
>
> > > dal = DAL()
> > > dal.define_namespace('app',request.application)
> > > dal.define_namespace('shared','_shared')
> > > dal.shared.define_database('gaedb','google')
> > > dal.app.define_database('gaedb','google')
> > > dal.shared.gaedb.define_table('posts',dal.Field('title'))
>
> > > db = dal.shared.gaedb
>
> > > db.posts._tablename -> '_shared__posts'
>
> > > Robin
>
> > > On Feb 7, 11:40 am, Robin B <robi...@gmail.com> 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 <robi...@gmail.com> wrote:
>
> > > > > I am implementing the joins onGAE, 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 web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to