Skip to content

Commit

Permalink
Add total_products to pagination context.
Browse files Browse the repository at this point in the history
  • Loading branch information
ArtemijRodionov committed Jan 18, 2019
1 parent 0cbe6b3 commit af5c85d
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions refarm_pagination/context.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ class PaginationContext:
def __init__(self, url, number, per_page, objects):
self.url = url
self.number = number
self.objects = objects
self.paginator = Paginator(objects, per_page)

def context(self):
Expand All @@ -27,4 +28,5 @@ def context(self):
'prev_pairs': prev_pairs,
'next_pairs': next_pairs,
'showed_count': showed_count,
'total_products': self.objects.count(),
}

0 comments on commit af5c85d

Please sign in to comment.