[sqlalchemy] Re: Query on a related object's field

2009-11-13 Thread Tefnet Developers - Tomasz Jezierski
Dnia 2009-11-13, Pt o godzinie 05:02 -0800, bojanb pisze: What is the easiest way of getting the equivalent of this: session.query(Someclass).filter_by(related_obj.field=somevalue) Ie. I want to filter by a field of an object that is in relation to objects of Someclass. My original

[sqlalchemy] Re: Query on a related object's field

2009-11-13 Thread Mike Conley
I haven't seen how to do this using the relation directly. I do: session.query(Someclass).join(OtherClass).filter_by(OtherClass.field==somevalue) I did do some experimenting with a more abstract approach, but did not find any need in my application. The only advantage is that it takes away the

[sqlalchemy] Re: Query on a related object's field

2009-11-13 Thread Conor
Mike Conley wrote: I haven't seen how to do this using the relation directly. I do: session.query(Someclass).join(OtherClass).filter_by(OtherClass.field==somevalue) I did do some experimenting with a more abstract approach, but did not find any need in my application. The only advantage