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).

Anthony


On Monday, June 13, 2016 at 10:04:25 AM UTC-4, Johann Spies wrote:
>
> We use PostgreSQL and make use of schemas for most of our work and use the 
> "rname"  option to do that in normal table definition.  
>
> I have looked through the source code of tools.py and cannot see where it 
> can be done to let the auth-related tables be created in a different schema 
> than 'public'.  
>
> How should I do it?
>
> 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 web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to