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

Werner F. Bruhin werner.bruhin at free.fr
Thu Jun 9 11:56:15 CEST 2005


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



More information about the orm-devel mailing list