[sqlalchemy] Re: Saving the results of a sqlalchemy join using Python

2009-01-20 Thread Boudewijn Ector
On Tue, Jan 20, 2009 at 8:24 AM, a...@svilendobrev.com wrote: mmh, cant really grasp what u want to do. what are Line.* attributes? .filter does and(), so this can be simplified: q = query(Line).filter( models.Line.LineDiscarded == LineDiscarded ) if ...: return q.filter( sites...)

[sqlalchemy] Re: Saving the results of a sqlalchemy join using Python

2009-01-20 Thread az
which join are u mentioning? and which result u want to save? the query itself or the objects it returns after execution? q = query(Line).join( Fiber, ...condition ).filter() if ... return q.filter( 123...) else: return q.filter( 456...) building that q is not expensive; saving it is fine

[sqlalchemy] Re: Saving the results of a sqlalchemy join using Python

2009-01-19 Thread az
mmh, cant really grasp what u want to do. what are Line.* attributes? .filter does and(), so this can be simplified: q = query(Line).filter( models.Line.LineDiscarded == LineDiscarded ) if ...: return q.filter( sites...) else: return q.filter( sites...) On Monday 19 January 2009 23:28:55