[sqlalchemy] Calling a PostgreSQL function taking %ROWTYPE

2014-09-08 Thread Tyler Bondy
I have a PostgreSQL function discounted_price(packages%ROWTYPE), where packages is a table. I would like to add a property on the model corresponding to the packages table which returns the result of the discounted_price function. Currently I have this which works: @property def

Re: [sqlalchemy] Calling a PostgreSQL function taking %ROWTYPE

2014-09-08 Thread Michael Bayer
put text() in there: func.discounted_price(text(packages.*)) On Sep 8, 2014, at 9:59 AM, Tyler Bondy ty.bo...@gmail.com wrote: I have a PostgreSQL function discounted_price(packages%ROWTYPE), where packages is a table. I would like to add a property on the model corresponding to the

Re: [sqlalchemy] Calling a PostgreSQL function taking %ROWTYPE

2014-09-08 Thread Tyler Bondy
Hmm, I've tried that and gotten the following error: ProgrammingError: (ProgrammingError) function discounted_price(unknown) is not unique LINE 1: SELECT discounted_price('packages.*') AS discounted_price_1 ^ HINT: Could not choose a best candidate function. You might need to

Re: [sqlalchemy] Calling a PostgreSQL function taking %ROWTYPE

2014-09-08 Thread Tyler Bondy
Ahh I think I've got it now, thanks a bunch. On Monday, September 8, 2014 12:13:41 PM UTC-4, Michael Bayer wrote: SQLAlchemy will send exactly what string you want. But you have to figure out what Postgresql wants. Maybe you don’t want those quotes in there?