Re: Legacy databases

2008-10-16 Thread Dj Gilcrease

Your first obstacle (currently) is going to be getting django to work
with multiple databases (the two Oracle and whatever its base DB is).
This is achievable, but undocumented and involves knowing the
internals of the QuerySet. Once you have that setup and functional (I
would create separate tables to play with while you are getting it
working) then you should be able to access the legacy DB models
normally, but you will NOT be able to create foreign keys to them for
models that are on a different database.

I have a similar need, to access an Oracle DB and 3 different MySQL
DBs from django and have, after digging into the internals enough to
understand what I would need to do, decided to wait and follow the
"Proposal: user-friendly API for multi-database support" thread on
django-developer and wait for an official API

Dj Gilcrease
OpenRPG Developer
~~http://www.openrpg.com

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Legacy Databases - custom filter?

2008-05-18 Thread Dougal

Thank your very much, thats just what I've been looking for.

:-)

Dougal

On May 18, 10:23 pm, "James Bennett" <[EMAIL PROTECTED]> wrote:
> On Sun, May 18, 2008 at 4:10 PM, Dougal <[EMAIL PROTECTED]> wrote:
> > How would I then do this SQL manually? I know writing SQL is to be
> > avoided but is there an easy way to execute SQL commands?
>
> Writing SQL is *not* to be avoided. Using an ORM is basically a
> trade-off, where some things are supported as ORM methods and some
> still require SQL (every ORM does this, even the most powerful ones).
>
> So if it looks like the Django ORM doesn't support the query you want
> to execute, you can do it manually, as documented:
>
> http://www.djangoproject.com/documentation/model-api/#executing-custo...
>
> --
> "Bureaucrat Conrad, you are technically correct -- the best kind of correct."
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Legacy Databases - custom filter?

2008-05-18 Thread James Bennett

On Sun, May 18, 2008 at 4:10 PM, Dougal <[EMAIL PROTECTED]> wrote:
> How would I then do this SQL manually? I know writing SQL is to be
> avoided but is there an easy way to execute SQL commands?

Writing SQL is *not* to be avoided. Using an ORM is basically a
trade-off, where some things are supported as ORM methods and some
still require SQL (every ORM does this, even the most powerful ones).

So if it looks like the Django ORM doesn't support the query you want
to execute, you can do it manually, as documented:

http://www.djangoproject.com/documentation/model-api/#executing-custom-sql


-- 
"Bureaucrat Conrad, you are technically correct -- the best kind of correct."

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---