[orm-devel] new many2one relationship in 0.9pre

Diedrich Vorberg orm-devel@mailman.tux4web.de
Tue, 18 Feb 2003 01:53:12 +0100


Good... morning?

I've added a new relationship/column pair called

  many2one

brought up my Mike, thought through and named by Ross and implemented
by myself this is a good example of teamwork ;-))

I moved some stuff from the one2one relationship into a common 
baseclass for 2one relationships which made more sense in terms of 
design than Mike's idea of just subclassing one2one, which would have 
worked, but this looks nicer.

If there are no major complains I'll raise orm some attention on 
freshmeat tomorrow with the 0.9 release.

There is 

   http://tux4web.de/orm/orm-0.9pre1.tar.gz

available now and I updated CVS repository, too.

One sidenote:
-------------
The changes have brought up an old problem I can see with orm:
caching. If you look at my test_many2one.py and run it you'll see that
orm performes one SELECT on the author table for each book although
most of them are redundant. I have intentionally not implemented a
caching mechanism of some sort, because I still want people to buy the
next version ;-) What I'm really saying is, caching, views and the oid
issue should wait untill after 1.0.

JOINs are another thing I'd like to take a look at. With the tables 
from my example you'd 

  SELECT book.id,book.title,author.id,author.name FROM book,author

Although this retrieves a lot of redundant data from the db it is 
actually better than orm's current solution: fewer (just one) SELECT 
request. I wonder how orm should do this. I have to think about this 
some more....

Any input is much appreciated!

Good night for me...
Diedrich

-- 
           _..._                            Diedrich Vorberg
         .'     '.
        /  _   _  \                         http://www.tux4web.de
        | (o)_(o) |                         info@tux4web.de
         \(     ) /            .---.
         //'._.'\ \           /     \       Internet Dienstleistungen
        //   .   \ \          \.@-@./       und 'Consulting'.
       ||   .     \ \         /`\_/`\
       |\   :     / |        //  _  \\      Linux Rules!
       \ `) '   (`  /_      | \     )|_
     _)``".____,.'"` (_    /`\_`>  <_/ \
     )     )'--'(     (    \__/'---'\__/
      '---`      `---`