[orm-devel] one2many problem in 1.0.1 when using getattr

Diedrich Vorberg diedrich at tux4web.de
Mon Jun 13 14:59:50 CEST 2005


Hi Werner,

> Just looked at this again and I see that I can either iterate over  
> it or even better just do a fetchall to get to my list the way I  
> got it in 0.16.
>
> So, I assume this is intended behavior in 1.0.1, can you just confirm.
confirmed! Getting the value of a relationship-attribute will always  
cause a SELECT query and return a selectResult, not a list. Values  
are not cached anymore. To get the children as a list I always write  
children = list(parent.attribute), but this is only needed if you  
iterate over the children more than once.

Diedrich

-- 
Diedrich Vorberg <diedrich at tux4web.de>      .---.   /             \
http://tux4web.de Tel: 02302 425269        /     \ ((__-^^-,-^^-__))
                                            \.O-O./  `-_---' `---_-'
"Unix is simple, but it takes a genius     /`\_/`\   `--|o` 'o|--'
to understand the simplicity."            //  _  \\     \  `  /
                       - Dennis Ritchie   | \     )|_     ): :(
                                         /`\_`>  <_/ \    :o_o:
      Associate Member of the FSF #1245  \__/'---'\__/     "-"



More information about the orm-devel mailing list