[orm-devel] Some questions

Diedrich Vorberg orm-devel@mailman.tux4web.de
Sun, 2 Mar 2003 20:59:34 +0100


Hi Werner,

>- Is there a way to define the foreign key columns - i.e. override the 
>default parenttable_id format to e.g. FK_whatever?
you can pass the columnName, foreignKeyColumn or one of the other
attributes to the relationship classes when defining your columns
dict. See the constructor of one2one, one2many, etc

>- BTW - the second address append uses the wrong object (home again 
>instead of atwork) - Will you fix this for msql and postgre or should I?
Done. Thanks!

>I am actually surprised that the append issues an Update, should we not 
>have to do the append first, and it only inserts the person id into the 
>address object and then do the insert for the address (no update).  The 
>current approach will NOT work if the DB enforces integrity or just does 
>not allow null in person_id.  
Correct.

There is a silly reason this is coded that way: I hadn't heard about 
SQL constrains at the time. I'll bring this up in a more general 
eMail shortly.

>- Is storing the height and width of the picture some db requirement?
Nope. Just a slightly younger me trying to show off with my knowlage 
of PIL and Python's unpack syntax. Also I wondered if the unpacking
would work well with my __setattr__() methods.

Storing image data in the RDMBS was a reqirement of the project ORM 
grew up with though.

>- Where do I get the PIL/image module from?  - the import throws an 
>error that it can't find it.

For PIL checkout

   http://www.pythonware.com/products/pil/

If you ever have to work with images PIL's absolutely cool. 

Diedrich

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