Re: [sqlalchemy] Filter options

2013-11-25 Thread Jonathan Vanasco
On Sunday, November 24, 2013 5:56:29 PM UTC-5, Joseph Casale wrote: On Sunday, November 24, 2013 3:44:32 PM UTC-7, Michael Bayer wrote conditonals? Yeah, the queries are just so long and with all the combinations of possible criteria it would get out of hand as I have about 6 optional

[sqlalchemy] Filter options

2013-11-24 Thread Joseph Casale
I am trying to write a convenience wrapper something like: def wrapper(self, arg_a=None, arg_a=None): query = self.session.query(Table_A).\ filter(Table_A.col_a == arg_a, Table_A.col_b == arg_b).\ all() ... The actual query is much longer, none the

Re: [sqlalchemy] Filter options

2013-11-24 Thread Michael Bayer
On Nov 24, 2013, at 5:33 PM, Joseph Casale jcas...@gmail.com wrote: I am trying to write a convenience wrapper something like: def wrapper(self, arg_a=None, arg_a=None): query = self.session.query(Table_A).\ filter(Table_A.col_a == arg_a, Table_A.col_b == arg_b).\

Re: [sqlalchemy] Filter options

2013-11-24 Thread Joseph Casale
On Sunday, November 24, 2013 3:44:32 PM UTC-7, Michael Bayer wrote conditonals? Yeah, the queries are just so long and with all the combinations of possible criteria it would get out of hand as I have about 6 optional arguments. Currently I leverage one filter method and use eval on formatted