I love the CASE statement, but yah I think its a cleaner in a view (also what DB's support this one ? let me guess, PG and Oracle and thats it....oh and MSSQL-9.nobodyhasit :) ). You can use literal strings too for this kind of thing. if you have some brilliant notion of how this would even look as Python expressions, that would be interesting to see. It would definitely live as a plugged-in extension. I should make an effort to formally define the "extensions" idea I have so that people can contribute whatever plugins they want. On Mar 17, 2006, at 12:20 PM, Jonathan Ellis wrote: I would think that the "right thing" to do here would be to map a view containing your case, instead of kludging this into the mapper code. |
- [Sqlalchemy-users] CASE in column list Rick Morrision
- Re: [Sqlalchemy-users] CASE in column list Jonathan Ellis
- Re: [Sqlalchemy-users] CASE in column list Michael Bayer
- Re: [Sqlalchemy-users] CASE in column list Rick Morrison
- Re: [Sqlalchemy-users] CASE in column list Michael Bayer
- Re[2]: [Sqlalchemy-users] CASE in column l... Gambit
- Re: Re[2]: [Sqlalchemy-users] CASE in... Rick Morrison
- Re[4]: [Sqlalchemy-users] CASE in... Gambit
- Re: Re[4]: [Sqlalchemy-users]... Rick Morrison
- Re: Re[4]: [Sqlalchemy-users]... Michael Bayer
- Re[6]: [Sqlalchemy-users] CAS... Gambit
- Re: Re[6]: [Sqlalchemy-users]... Michael Bayer
- Re: Re[4]: [Sqlalchemy-users]... Rick Morrison