On 15 June 2016 at 17:54, Anthony <[email protected]> wrote: > It's a bit of a hack and I haven't tried it so not sure it will work, but > maybe something like this: > > db._lazy_tables = True > auth.define_tables() > lt = db._LAZY_TABLES > [lt[t][2].update(rname='myschema.%s' % t) for t in db.tables if t. > startswith('auth')] > db._lazy_tables = False > > The idea is to use lazy table definitions. In that case, for each table, > there is a tuple in db._LAZY_TABLES, the third element of which is a > dictionary of the arguments to define the table. The above code loops > through the Auth tables and updates the arguments of each to include > "rname" with the schema name prepended to the table name. The full table > definition won't happen until the first time the table is accessed, at > which point, the "rname" will be set accordingly. > > Of course, the first and last lines are not necessary if you already have > DAL(..., lazy_tables=True). >
Thank you Anthony. This is very useful! Regards Johann -- Because experiencing your loyal love is better than life itself, my lips will praise you. (Psalm 63:3) -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups "web2py-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.

