From: Matthew Wilson <matt@tp...> - 2008-08-06 17:23:51
This is the SQL I want to do:
select employee.*, 1 + 1 as x
where employee.id = 44;
I know how to do this:
User.select(User.q.id == 44)
But how can I get the extra column?
In my real-world example, the extra column is more complex.
On Wed, Aug 06, 2008 at 05:23:34PM +0000, Matthew Wilson wrote:
> This is the SQL I want to do:
> select employee.*, 1 + 1 as x
> from employee
> where employee.id = 44;
> I know how to do this:
> User.select(User.q.id == 44)
> But how can I get the extra column?
You have to declared the column in the User class:
extra = MyCol()
Or you can use sqlbuilder.Select() - it allows to select arbitrary list
Oleg Broytmann http://phd.pp.ru/ phd@...
Programmers don't die, they just GOSUB without RETURN.
Get latest updates about Open Source Projects, Conferences and News.