Vinkesh/Santhosh | Added pagination to IpBlockController which will provide the next link

This commit is contained in:
Santhosh Kumar
2011-07-27 11:29:00 +05:30
committed by Rajaram Mallya
parent 3335c0f9d1
commit 135ac350e0
5 changed files with 55 additions and 11 deletions

View File

@@ -54,6 +54,12 @@ class Query(object):
limit=limit, marker=marker,
marker_column=marker_column)
def paginated_collection(self, limit=200, marker=None, marker_column=None):
collection = self.limit(int(limit) + 1, marker, marker_column)
if len(collection) > int(limit):
return (collection[0:-1], collection[-2]['id'])
return (collection, None)
class ModelBase(object):
_columns = {}