[sqlalchemy] Re: defer relation load in a query more than one relation away

2010-03-18 Thread Kent
I should have mentioned that even when I was using lazyload() I was getting the same problem, but I think I corrected my problem with this: o=DBSession.query(Order).options(lazyload(Order.orderdetails,OrderDetail.product)).get(u'SALE35425') I think I understand better now: is it correct that

Re: [sqlalchemy] Re: defer relation load in a query more than one relation away

2010-03-18 Thread Michael Bayer
Kent wrote: I should have mentioned that even when I was using lazyload() I was getting the same problem, but I think I corrected my problem with this: o=DBSession.query(Order).options(lazyload(Order.orderdetails,OrderDetail.product)).get(u'SALE35425') I think I understand better now: is

[sqlalchemy] Re: defer relation load in a query more than one relation away

2010-03-17 Thread Kent
Does defer only relate to ColumnProperty while lazyload relates to RelationProperty? Apparently I should be using lazyload() instead of defer()? -- You received this message because you are subscribed to the Google Groups sqlalchemy group. To post to this group, send email to

Re: [sqlalchemy] Re: defer relation load in a query more than one relation away

2010-03-17 Thread Michael Bayer
Kent wrote: Does defer only relate to ColumnProperty while lazyload relates to RelationProperty? Apparently I should be using lazyload() instead of defer()? that is the case at the moment yes. But I can see that perhaps defer() should be dual-purposed here. the eager/lazy terminology used