[sqlalchemy] Re: Adding expressions to a Query

2010-12-05 Thread Jurie-Jan Botha
 one option would be to add the expression to your model as a column_property

This is unfortunately not an option as this extra column compiles it's
value from the values of more than one model.

-- 
You received this message because you are subscribed to the Google Groups 
sqlalchemy group.
To post to this group, send email to sqlalch...@googlegroups.com.
To unsubscribe from this group, send email to 
sqlalchemy+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en.



[sqlalchemy] Re: Adding expressions to a Query

2010-12-05 Thread Jurie-Jan Botha
I found that it's really as easy as using query.add_columns(). My
problem was caused by my not reading the documentation properly and
trying to use a list in the add_columns() method instead of just
positional arguments.

  one option would be to add the expression to your model as a column_property

 This is unfortunately not an option as this extra column compiles it's
 value from the values of more than one model.

-- 
You received this message because you are subscribed to the Google Groups 
sqlalchemy group.
To post to this group, send email to sqlalch...@googlegroups.com.
To unsubscribe from this group, send email to 
sqlalchemy+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en.



[sqlalchemy] Excluding a column form Query result

2010-12-05 Thread Jurie-Jan Botha
Is there a way to add a column to a Query object to be used elsewhere
in the query, but prevent it from being listed in the result of the
Query?

-- 
You received this message because you are subscribed to the Google Groups 
sqlalchemy group.
To post to this group, send email to sqlalch...@googlegroups.com.
To unsubscribe from this group, send email to 
sqlalchemy+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en.



[sqlalchemy] Adding expressions to a Query

2010-12-03 Thread Jurie-Jan Botha
I can't seem to find a way to add an expression to an ORM Query as a
column. I need to add it after the Query object is initialized.

The expressions that I'm trying to add is a function like
'func.ts_rank_cd'.

Thanks in advance.

-- 
You received this message because you are subscribed to the Google Groups 
sqlalchemy group.
To post to this group, send email to sqlalch...@googlegroups.com.
To unsubscribe from this group, send email to 
sqlalchemy+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en.