On Jun 20, 2010, at 9:08 PM, Jonathan Vanasco wrote: >> you want to look at: >> 1. query.values(Class.foo, Class.bar) > > ah, thank you very much. > > i was struggling with that earlier from the API -- i thought i only > needed to do > > query.values( foo , bar ) > > but that didn't work. > >> 2. Session.query(Class.foo, Class.bar).all() >> #2 is in the ORM tutorial, and both are in the full Query API documentation. > > I didn't see that; I'm going to have to try it. > > I have a related question... exactly what should query.value() > return ? on a test query, it seemed to have returned the first row of > a result ( ie: the first id column in a set of 10 id columns ) -- is > this the intended behavior ? I was assuming that value() is used for > 1 column, and values() is used for several.
its for a scalar: http://www.sqlalchemy.org/docs/reference/orm/query.html?highlight=query.value#sqlalchemy.orm.query.Query.value > > -- > 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. > -- 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.