Hello,

OK I figured this out:

rsvp = session.query(Project.project, Project.id, func.count(Reservation.project_id)).join(Reservation.project).group_by(Project.project, Project.id).order_by(desc(func.count(Reservation.project_id))).all()

I'm not normally a vaseline man, but this is amazing: how did SQLA guess *correctly* what I wanted here? I love this toolkit!


--

Regards,
mk

--
Premature optimization is the root of all fun.

--
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.

Reply via email to