[sqlalchemy] Re: Column expressions and .count()

2009-07-15 Thread Kyle Schaffrick
On Mon, 13 Jul 2009 19:18:39 -0400 Michael Bayer mike...@zzzcomputing.com wrote: Brad Wells wrote: Is it possible to perform a query.count() on a query with a labeled column expression without count() adding the subselect? I need to filter on the value of the expression and get a count

[sqlalchemy] Re: Column expressions and .count()

2009-07-15 Thread Michael Bayer
Kyle Schaffrick wrote: On Mon, 13 Jul 2009 19:18:39 -0400 Michael Bayer mike...@zzzcomputing.com wrote: Brad Wells wrote: Is it possible to perform a query.count() on a query with a labeled column expression without count() adding the subselect? I need to filter on the value of the

[sqlalchemy] Re: Column expressions and .count()

2009-07-15 Thread Kyle Schaffrick
On Wed, 15 Jul 2009 10:35:24 -0400 Michael Bayer mike...@zzzcomputing.com wrote: Kyle Schaffrick wrote: On Mon, 13 Jul 2009 19:18:39 -0400 Michael Bayer mike...@zzzcomputing.com wrote: Brad Wells wrote: Is it possible to perform a query.count() on a query with a labeled

[sqlalchemy] Re: Column expressions and .count()

2009-07-15 Thread Michael Bayer
On Jul 15, 2009, at 5:03 PM, Kyle Schaffrick wrote: len(query) forces us to play games with the __iter__ method on query such that it can't be a real iterator. Hmm, I thought there was a __len__ magic method, such that len(something) is the same as something.__len__(), when the latter is

[sqlalchemy] Re: Column expressions and .count()

2009-07-13 Thread Michael Bayer
Brad Wells wrote: Is it possible to perform a query.count() on a query with a labeled column expression without count() adding the subselect? I need to filter on the value of the expression and get a count for a paged view. use query.value(func.count(some column)).I'm seriously

[sqlalchemy] Re: Column expressions and .count()

2009-07-13 Thread Michael Bayer
Brad Wells wrote: Is it possible to perform a query.count() on a query with a labeled column expression without count() adding the subselect? I need to filter on the value of the expression and get a count for a paged view. although reading the docs to query.count(), its pretty clear as far