Hello

For reasons I won't bore you with, a Mysql legacy DB *whose schema I
cannot alter* contains (inter alia) two tables.  I'm trying to write
an alternative front-end to this DB in Django which would be
read-only.

tableone has a primary key called tableone_id

tabletwo contains rows which have a 1:1 relationship with equivalent
rows in tableone, and a column called tableone_id to allow me connect
them with a JOIN.  It does not, however, have a primary key of its
own.

It seems obvious to me that these two tables belong in one Model
definition. How do I define a single model which spans the two tables
and returns querysets containing all columns from both tables?

a)  With a model manager?  If so, where do I put that manager and are
there any examples I can steal?
b)  With custom SQL in the model definition?  If so, again, does
someone have an example online I can see somewhere?
c)  Somewhere else?

Any help gratefully received.

Cheers



John Handelaar

--~--~---------~--~----~------------~-------~--~----~
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