order_by('counted') 

?

there's a feature for 1.0 that will actually search out "counted" when you pass 
as a string and match it up too. 


On Jul 30, 2014, at 3:35 PM, Jonathan Vanasco <[email protected]> wrote:

> Revisiting this question, with coalesce.  The target sql is:
> 
>         SELECT 
>              letter
>             ,COALESCE(cache_counted, 0) AS counted
>         FROM letters
>         ORDER BY counted DESC
> 
> The closest I can get to it is this:
> 
>         dbSession.query(
>             sqlalchemy.func.count( model.Letters.letter ),
>             sqlalchemy.func.coalesce( model.Letters.cache_counted, 
> 0).label('counted'),
>         ).order_by(
>             sqlalchemy.func.coalesce( model.Letters.cache_counted, 0).desc
>         )
> 
> 
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "sqlalchemy" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to [email protected].
> To post to this group, send email to [email protected].
> Visit this group at http://groups.google.com/group/sqlalchemy.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sqlalchemy.
For more options, visit https://groups.google.com/d/optout.

Reply via email to