Vinkesh/Santhosh | Added pagination to IpBlockController which will provide the next link
This commit is contained in:
committed by
Rajaram Mallya
parent
3335c0f9d1
commit
135ac350e0
@@ -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 = {}
|
||||
|
||||
Reference in New Issue
Block a user