Something that might be biting you is if one of those columns is a string column. In Python, multiplying a string by an int results in repeating that string. Due to the knowledge contained in SA, it would know about this, and expect to see a string result, which means it would pass in a string parameter. Double check and make sure the two columns are numeric in nature.
And, if that's not it, I got nothing, I'm sorry to say. I hope your problem was able to be fixed. 2010/7/22 Timuçin Kızılay <[email protected]> > Diez B. Roggisch yazmış: > >> On Thursday, July 22, 2010 12:24:53 Timuçin Kızılay wrote: >> >>> Diez B. Roggisch yazmış: >>> >>>> On Thursday, July 22, 2010 11:47:13 Timuçin Kızılay wrote: >>>> >>>>> I'm trying to make a query like this: >>>>> >>>>> prc_filter = 24 >>>>> >>>>> q_sometable = DBSession.query(model.Sometable) >>>>> q_sometable = q_sometable.filter((model.Sometable.qty * >>>>> model.Sometable.price)==prc_filter) >>>>> >>>>> This do not give any error and when I look at the paster log I see that >>>>> it generated a query with where part like this: >>>>> >>>>> ------------ >>>>> WHERE sometable.qty * sometable.price = ? >>>>> >>>>> 12:41:24,272 INFO [sqlalchemy.engine.base.Engine.0x...ba0c] ['24'] >>>>> >>>> This looks as if the above is *not* what you really do. Because '24' is >>>> a >>>> *string*, not an integer... >>>> >>>> Diez >>>> >>> No, it's an integer but the log shows it as string. >>> I think the problem is filtering on two columns multiplied. >>> >>> When I filter only one column, it works. >>> >>> q_sometable = q_sometable.filter(model.Sometable.price==prc_filter) >>> >>> this filter works and generated sql shown on the log is still ['24'] but >>> it works. >>> >> >> Ah. Strange enough. >> >> I think it's a SA bug, it try to put those values into query as >>> parameters. >>> >>> >> If so, I suggest you take it to the SA-mailinglist. Michael Bayer is >> incredible responsive. Of course you should try with the latest + greatest >> SA first. >> >> Diez >> >> > Hello. > is the SA mailinglist is this one ? [email protected]. > > I'll forward this message to SA mailinglist now... I hope that mailinglist > is as friendly as this one. > > > -- > You received this message because you are subscribed to the Google Groups > "TurboGears" group. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]<turbogears%[email protected]> > . > For more options, visit this group at > http://groups.google.com/group/turbogears?hl=en. > > -- Michael J. Pedersen My IM IDs: Jabber/[email protected], ICQ/103345809, AIM/pedermj022171 Yahoo/pedermj2002, MSN/[email protected] -- You received this message because you are subscribed to the Google Groups "TurboGears" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/turbogears?hl=en.

