Re: [sqlalchemy] filter vs get question

2014-02-20 Thread Claudio Freire
On Thu, Feb 20, 2014 at 5:22 PM, Jonathan Vanasco jonat...@findmeon.com wrote: this seems to work, but I want to just make sure this is the intended behavior. a = dbSession.query( Something ).filter( Something.primary_key == 1 ).first() b = dbSession.query( Something ).get( 1 ) c =

Re: [sqlalchemy] filter vs get question

2014-02-20 Thread Jonathan Vanasco
that's fine. this is for a webapp where we have in a single request : begin; user = .filter().first() DO LOTS OF STUFF, all over the place DO EVEN MORE STUFF , in more places user = .get(user_id) commit; if this behavior is intended, then we can just rely on it for now.

Re: [sqlalchemy] filter vs get question

2014-02-20 Thread Michael Bayer
On Feb 20, 2014, at 3:22 PM, Jonathan Vanasco jonat...@findmeon.com wrote: this seems to work, but I want to just make sure this is the intended behavior. a = dbSession.query( Something ).filter( Something.primary_key == 1 ).first() b = dbSession.query( Something ).get( 1 ) c