pagination: handle empty sets of data in sqlPaginator for backward compat.
marcink -
r4156:5c498811 default
Not Reviewed
Show More
Add another comment
TODOs: 0 unresolved 0 Resolved
COMMENTS: 0 General 0 Inline
@@ -911,6 +911,10
911 return self.collection[range]
911 return self.collection[range]
912
912
913 def __len__(self):
913 def __len__(self):
914 # support empty types, without actually making a query.
915 if self.collection is None or self.collection == []:
916 return 0
917
914 # Count the number of objects in an sqlalchemy.orm.query.Query object
918 # Count the number of objects in an sqlalchemy.orm.query.Query object
915 return self.collection.count()
919 return self.collection.count()
916
920
Comments 0
You need to be logged in to leave comments. Login now