Re: Routing to database based on user

2017-02-22 Thread Wilkinson Tavares
Hi Tom, Did the solution Ansii suggested work? Have you got some scalability problem with this solution? On Monday, 30 January 2012 19:01:21 UTC-3, Tom Eastman wrote: > > Hey guys, > > I'm writing a django project that will require me to route queries to > certain large databases based on who the

Re: Routing to database based on user

2012-02-02 Thread akaariai
On Feb 3, 1:30 am, Tom Eastman wrote: > Here is my solution, I wonder if you could just tell me if you think > there's a major problem with it. > > In simplistic terms, the goal is "whenever a model from wxdatabase is > accessed, route the query to the database specified in the user's > organiza

Re: Routing to database based on user

2012-02-02 Thread Tom Eastman
On 31/01/12 11:45, akaariai wrote: > On Jan 31, 12:01 am, Tom Eastman wrote: >> Hey guys, >> >> I'm writing a django project that will require me to route queries to >> certain large databases based on who the logged in user is. >> >> So all the tables for django.contrib.auth and session and stuff

Re: Routing to database based on user

2012-01-30 Thread akaariai
I forgot one thing: be cautious with transactions. The transaction middleware will start a transaction only on 'default' alias. So, you will probably need to use the transactions.commint_on_success / commit_manually with the using parameter to make this work reliably. Or write your own transaction

Re: Routing to database based on user

2012-01-30 Thread akaariai
On Jan 31, 12:01 am, Tom Eastman wrote: > Hey guys, > > I'm writing a django project that will require me to route queries to > certain large databases based on who the logged in user is. > > So all the tables for django.contrib.auth and session and stuff will be > in the 'central' database, as we

Routing to database based on user

2012-01-30 Thread Tom Eastman
Hey guys, I'm writing a django project that will require me to route queries to certain large databases based on who the logged in user is. So all the tables for django.contrib.auth and session and stuff will be in the 'central' database, as well as a table that maps users to which database they