Skip to content

Commit

Permalink
fidals/shopelectro#701 Add total_products to pagination context. (#249)
Browse files Browse the repository at this point in the history
  • Loading branch information
ArtemijRodionov authored Jan 19, 2019
1 parent 7f8215a commit a1a90b6
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 a1a90b6

Please sign in to comment.