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

Werner F. Bruhin werner.bruhin at free.fr
Fri Jun 10 14:00:05 CEST 2005


Hi Diedrich,

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.

See you
Werner

Werner F. Bruhin wrote:

> Hi Diedrich,
>
> Can you point me in the right direction on how to fix this problem in 
> 1.0.1.
>
> In 0.16
> Changing the example test_one2many.py to include this:
> print '---- getattr ----'
> print getattr(p, 'children')
> print '---- getattr end ----'
>
> Results in:
> ---- getattr ----
> [<child (pyid=11152680 oid=1 child_data='child data 1' id=1>, <child 
> (pyid=11153360 oid=1 child_data='child data 2' id=2>, <child 
> (pyid=11182208 oid=1 child_data='child data 3' id=3>, <child 
> (pyid=11182328 oid=1 child_data='child data 4' id=4>, <child 
> (pyid=11182448 oid=1 child_data='child data 5' id=5>]
> ---- getattr end ----
>
> In 1.0.1:
> Changing the example one2many_relationship.py to include this:
> print '---- getattr ----'
> print getattr(diedrich, 'emails')
> print '---- getattr end ----'
>
> Results in:
> ---- getattr ----
> SELECT email.local, email.remote, email.id FROM email WHERE person_id=1
> <selectResult with 0 objects (rows)>
> ---- getattr end ----
>
> Best regards
> Werner
>
> Configuration:
> Python 2.4.1
> Orm 1.0.1 or 0.16
> Firebird 1.5
>
> _______________________________________________
> orm-devel mailing list
> orm-devel at mailman.tux4web.de
> http://mailman.tux4web.de/mailman/listinfo/orm-devel
>
>
>




More information about the orm-devel mailing list