Re: Connection with third database using multidb implementing DB Router

2013-11-08 Thread Ovnicraft
I will check it ! thanks ! On Fri, Nov 8, 2013 at 12:19 PM, George Silva wrote: > Let me explain this better. > > I've created a custom manager, in which I replaced the default database > alias it should connect. > > class ExternalManager(models.Manager): > > > """ > > Manager customizado

Re: Connection with third database using multidb implementing DB Router

2013-11-08 Thread George Silva
Let me explain this better. I've created a custom manager, in which I replaced the default database alias it should connect. class ExternalManager(models.Manager): """ Manager customizado para buscar os dados no banco legado. """ alias = None def __init__(self, alias=None):

Re: Connection with third database using multidb implementing DB Router

2013-11-08 Thread Ovnicraft
On Fri, Nov 8, 2013 at 11:39 AM, George Silva wrote: > I only had to query external databases. > > I've created my models as managed=False and implemented a custom manager > that redefined the default database configuration. We did not had > situations where depending on a certain condition the ta

Re: Connection with third database using multidb implementing DB Router

2013-11-08 Thread George Silva
I only had to query external databases. I've created my models as managed=False and implemented a custom manager that redefined the default database configuration. We did not had situations where depending on a certain condition the target database would change, but this worked just fine. On Fri