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:

class MyCol(Col):
   ...implementation...

class User(SQLObject):
   extra = MyCol()
   ...other columns...

   Or you can use sqlbuilder.Select() - it allows to select arbitrary list
of columns.

Oleg.
-- 
     Oleg Broytmann            http://phd.pp.ru/            [EMAIL PROTECTED]
           Programmers don't die, they just GOSUB without RETURN.

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
sqlobject-discuss mailing list
sqlobject-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sqlobject-discuss

Reply via email to