views:

419

answers:

2

Hi everybody, I have one question concerning Python and the sqlalchemy module. What is the equivalent for cursor.rowcount in the sqlalchemy Python?

Thank you

+2  A: 

Although it isn't really stated in the docs, a ResultProxy object does have a rowcount property as well.

DNS
A: 
session.query(ClassName).count()

This can be done for any query result, filtered or not.

Matthew Schinckel