Thanks Michael,

I've using stored procedures on update events, it seems to do the work
just fine.

I designed it to use the secondary DB after user login and all of the
apps operations are done within the secondary realm.

User, Group, and Permissions are 'cloned' to _User, _Group and
_Permissions.

So far so good, my nosetests are broken though.  Can't seem to make
them work on the dual scenery.



On Feb 22, 10:10 pm, Michael Pedersen <[email protected]> wrote:
> Doing cross-database joins can only be done in a very few ways. I've seen
> support for it work on Sybase, I think it could maybe work on MySQL, and
> for all of those times, you would have to use raw sql. Aside from having a
> program to copy data from one to the other, I don't see any feasible way to
> do it.
>
>
>
>
>
>
>
>
>
> On Wed, Feb 15, 2012 at 10:56 PM, Juparave <[email protected]> wrote:
> > Hello everyone,
>
> > I'm planning on building an application which creates a secondary
> > database according to user 'families'
>
> > engine1 = engine_from_config(pylons_config, 'sqlalchemy.main.')
> > engine2 = engine_from_config(pylons_config, 'sqlalchemy.secondary.')
>
> > on init_model...
> > DBSessionMain.configure(bind=engine1)
> > DBSession.configure(bind=engine2)
>
> > metadata_main.bind = engine1
> > metadata.bind = engine2
>
> > on auth module
> > # Auth module on main database
> > #from fampics.model import DeclarativeBase, metadata, DBSession
> > from fampics.model import DeclarativeBase_main as DeclarativeBase
> > from fampics.model import metadata_main as metadata
> > from fampics.model import DBSessionMain as DBSession
>
> > The rest of the modules points to 'normal' DeclarativeBase, metadata,
> > and DBSession which in this case actually they're pointing to the
> > secondary DB.
>
> > Some of the tables have foreign keys ie. tg_user.id (photo.owner_id --
> > > tg_user.id)
>
> > So on the setup-app I receive """sqlalchemy.exc.ArgumentError: Could
> > not locate any foreign-key-equated, locally mapped column pairs for
> > primaryjoin condition 'photo.owner_id = tg_user.user_id'"""
>
> > I load a copy of the auth.py module (auth_sec.py) data objects at the
> > end of __init_.py to force the creation of the auth module tables on
> > the secondary DB with no success.
>
> > from apolo.model.auth import User, Group, Permission
> > from apolo.model.auth_sec import User as _User, Group as _Group,
> > Permission as _Permission
>
> > How can I do it?
>
> > I wish to duplicate the contents of main.tg_user table on
> > secondary.tg_user preferably only family users, maybe this I'll do it
> > programatically.
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "TurboGears" 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/turbogears?hl=en.
>
> --
> Michael J. Pedersen
> My Online Resume:http://www.icelus.org/-- Google+http://plus.ly/pedersen
> Google Talk: [email protected] -- Twitter: pedersentg

-- 
You received this message because you are subscribed to the Google Groups 
"TurboGears" 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/turbogears?hl=en.

Reply via email to