[orm-devel] Is anyone running MySQL? Check out the new join function in ORM!
9 Sep 2003 21:08:59 -0000
it's not even 100 lines of code, but it took me more than three hours
to complete. No, I didn't hurt my hands, that's just how complicated
this is. Sometimes I think, I'm doing something wrong with the overall
design. On the other hand, I guess there are things that are
complicated by nature and no matter how hard you try to split it up in
simpler chunks it doesn't get mich easyer to understand.
Anyway, you can do joins over tables now with orm.
This works for one2one and many2one relatoinships. The idea is, that
if you SELECT from a table that has, say, a many2one relationship to
another and you get 100 objects as a result, you'll have to do 100
SELECTs on the other table to get your 100 childobjects. Now you can
result = ds.select(join(parent_class))
and it will return parent_class objects with the data already in them
retrieved in a single SELECT!
It's in the CVS version but I'm afraid this will only work with
MySQL. Sorry about this... See the examples/mysql/ directory for
_..._ Diedrich Vorberg
/ _ _ \ http://www.tux4web.de
| (o)_(o) | email@example.com
\( ) / .---.
//'._.'\ \ / \ Internet Dienstleistungen
// . \ \ \.@-@./ und 'Consulting'.
|| . \ \ /`\_/`\
|\ : / | // _ \\ Linux Rules!
\ `) ' (` /_ | \ )|_
_)``".____,.'"` (_ /`\_`> <_/ \
) )'--'( ( \__/'---'\__/