There are a few things "model" package is used for, so you probably want it to act as a proxy to your real models.
Unless manually specified "model.DBSession" is your application session, and it's used for authentication queries. You can off course change this by rolling your own TGAuthMetadata, but many pluggables apps and extensions will take for granted that model.DBSession is your app session, so if you have more than one you want to pick one to be the main one. Which is probably the one with User, Group and Permission tables. model.User, model.Group, model.Permission are considered to be your User, Group and Permission models by most extensions and plugins. model.* is where all the models rely by default TGAdmin configuration, if you need to administer two groups of models you will need to create two different admin instances one for each models group. In TG itself you can change those settings through AppConfig without major issues, just take note that plugins and extensions might take for granted that DBSession and models are inside the model package. There is a rough tutorial available in TG doc regarding multiple databases, you might want to have a look at it http://turbogears.readthedocs.org/en/latest/cookbook/multiple-databases.html On Mon, Sep 21, 2015 at 11:21 PM, Paul Kraus <[email protected]> wrote: > I should i add currently setting the scheme in the model __init__.py folder > metadata.schema = 'schemaname' > > > On Monday, September 21, 2015 at 5:20:22 PM UTC-4, Paul Kraus wrote: >> >> I have an app where i need to have models attached to two different >> schemas in the same database. Am i better off have two model folders and >> setting the scheme in the init of each or use the table schema arg on a per >> class basis. >> >> The first option seems way better but i am not sure if there are any >> gotchas with TG and the model folder. >> >> >> -- > You received this message because you are subscribed to the Google Groups > "TurboGears" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To post to this group, send email to [email protected]. > Visit this group at http://groups.google.com/group/turbogears. > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "TurboGears" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/turbogears. For more options, visit https://groups.google.com/d/optout.

