Re: Multi-db: is database routing per request possible?

2010-06-16 Thread johan de taeye
Russ, Your gut feeling confirms my suspicion. Changing the lines to the following fixes my problem: db = model_instance._state.db if db is None: db = router.db_for_write(model_instance.__class__, instance=model_instance) qs =

Re: Multi-db: is database routing per request possible?

2010-06-15 Thread Russell Keith-Magee
On Tue, Jun 15, 2010 at 9:11 PM, johan de taeye wrote: > >> You can't do this with a router; as you've noted, the router doesn't >> have any information about the request in which it is being used. >> >> However, you could do it by manually requesting your database >>

Re: Multi-db: is database routing per request possible?

2010-06-15 Thread johan de taeye
> You can't do this with a router; as you've noted, the router doesn't > have any information about the request in which it is being used. > > However, you could do it by manually requesting your database > connection whenever you use the database. For example: > >

Re: Multi-db: is database routing per request possible?

2010-06-15 Thread Russell Keith-Magee
On Tue, Jun 15, 2010 at 7:12 PM, johan de taeye wrote: > Hello, > > In my application a number of databases are configured with identical > schemas. > From a dropdown box on the screen, the user selects the database he/ > she wants to work with.  The selected database is

Re: Multi-db: is database routing per request possible?

2010-06-15 Thread Alexander Jeliuc
I didn't work with multidb but I think it is possible anyway... try it using additional middleware... for example.. change dynamically db settings... etc On Tue, Jun 15, 2010 at 2:12 PM, johan de taeye wrote: > Hello, > > In my application a number of databases are

Multi-db: is database routing per request possible?

2010-06-15 Thread johan de taeye
Hello, In my application a number of databases are configured with identical schemas. >From a dropdown box on the screen, the user selects the database he/ she wants to work with. The selected database is stored on the cookie. An object with the same primary key can be created in each schema by