[sqlalchemy] Re: Queries on computed properties

2007-05-03 Thread Kirk Strauser
On May 2, 2007, at 8:32 PM, Michael Bayer wrote: oh duh, i forgot about the new thing Gaetan came up with, try this too: mapper(Invoice, invoice_table, properties={ 'customer':column_property(func.substr(invoice_table.c.invnum, 1, 4).label('customer')) }) That's so very, *very*

[sqlalchemy] Re: Queries on computed properties

2007-05-03 Thread Michael Bayer
On May 3, 2007, at 5:29 PM, Kirk Strauser wrote: The killer part is the (substring(rdy2bill.xmlvars, %(substring)s) AS groupcode = in the WHERE clause. PostgreSQL apparently doesn't want that predicate to be named. Can that be disabled? -- not really (well yes, you can take the

[sqlalchemy] Re: Queries on computed properties

2007-05-03 Thread Michael Bayer
no wait, scratch my last email for a bit. try rev 2601. On May 3, 2007, at 5:29 PM, Kirk Strauser wrote: On May 2, 2007, at 8:32 PM, Michael Bayer wrote: oh duh, i forgot about the new thing Gaetan came up with, try this too: mapper(Invoice, invoice_table, properties={

[sqlalchemy] Re: Queries on computed properties

2007-05-03 Thread Kirk Strauser
On May 3, 2007, at 5:18 PM, Michael Bayer wrote: not really (well yes, you can take the label off, but then you dont get it in your columns clause, so that will break). mapping to the select statement that includes the column is the more general solution here (also allows the function

[sqlalchemy] Re: Queries on computed properties

2007-05-03 Thread Kirk Strauser
On May 3, 2007, at 5:31 PM, Michael Bayer wrote: no wait, scratch my last email for a bit. try rev 2601. Perfect! That was exactly what it needed. I have to say that after using SQLAlchemy for about a week, I'm really excited about this. -- Kirk Strauser

[sqlalchemy] Re: Queries on computed properties

2007-05-02 Thread Michael Bayer
On May 2, 1:54 pm, Kirk Strauser [EMAIL PROTECTED] wrote: I'm new to SQLAlchemy and not sure exactly how to explain this in its terminology, so please bear with me. We moving to replace an in-house developed ORM with SQLAlchemy because it works better with the software we want to use. One

[sqlalchemy] Re: Queries on computed properties

2007-05-02 Thread Michael Bayer
oh duh, i forgot about the new thing Gaetan came up with, try this too: mapper(Invoice, invoice_table, properties={ 'customer':column_property(func.substr(invoice_table.c.invnum, 1, 4).label('customer')) }) --~--~-~--~~~---~--~~ You received this message