Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Add support for serializing to json paginated collections
  • Loading branch information
amol- committed May 19, 2013
1 parent 29540be commit 1415675
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions tg/support/paginate.py
Expand Up @@ -433,3 +433,9 @@ def __iter__(self):

def __len__(self):
return len(self.items)

def __json__(self):
return {'total':self.item_count,
'page':self.page,
'items_per_page':self.items_per_page,
'entries':self.items}

0 comments on commit 1415675

Please sign in to comment.