Work with SQLAlchemy 0.6 (Bug #611889)

This commit is contained in:
Jon Tibble 2010-08-02 03:53:14 +01:00
parent 41ed61bfe3
commit 72c2336d84

View File

@ -199,7 +199,7 @@ class Manager(object):
Any parameters to order the returned objects by. Defaults to None.
"""
query = self.session.query(object_class)
if filter_clause:
if filter_clause is not None:
query = query.filter(filter_clause)
if order_by_ref is not None:
return query.order_by(order_by_ref).all()
@ -237,7 +237,7 @@ class Manager(object):
"""
try:
query = self.session.query(object_class)
if filter_clause:
if filter_clause is not None:
query = query.filter(filter_clause)
query.delete(synchronize_session=False)
self.session.commit()