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 for a paged
> > view.
> 
> although reading the docs to query.count(), its pretty clear as far as
> querying mapped entities vs. column expressions.  I think it might
> just need very clear documentation that, for counting anything more
> complex than query(Foo).filter().count(), you should be using column
> expressions.
> 

Idea: query.count() could be superseded by len(query) so that it clearly
suggests the intended use case of "how many things are returned by this
query" instead of the wierd SQL concept of count(), which should be
served by column expressions. It also nicely aligns it with other Python
collection-y things.

-Kyle

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to sqlalchemy@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
-~----------~----~----~----~------~----~------~--~---

Reply via email to