On Sat, Oct 31, 2009 at 12:34 AM, Gustavo Henrique <gustavo...@gmail.com> wrote:
>
> Hi!
> I have a project using mysql and it have to access a firebird BD for
> get data.
> What the better way to use 2 databases in django? What you recommend
> me to do? Maybe SQLAlchemy?

Right now, Django doesn't have an easily accessible built-in solution
for this. It is possible, but you need to dig into some internals.

More importantly, the internals in question are about to change -
support for multiple databases is one of the features that we are
working on for v1.2.

So - you have a couple of options. In increasing level of difficulty:

 1) Manually open a second database connection, and retrieve the data
using the cursor.

 2) Use something like SQLAlchemy - essentially the same answer as
(1), but with a nicer API.

 3) Use the in-development multi-db branch. See ticket #1142 for details.

 4) Poke around the existing API and see if you can get it to work. As
a hint - you're looking to construct QuerySet objects with a sql.Query
that has been pre-constructed with your connection of choice.

Yours,
Russ Magee %-)

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to