[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 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
(‘packages.*’)) won’t quote like that: from sqlalchemy import func, text print func.discounted_price(text('packages.*')) discounted_price(packages.*) On Sep 8, 2014, at 12:10 PM, Tyler Bondy ty.b...@gmail.com javascript: wrote: Hmm, I've tried that and gotten the following error