0

I have list pages showing event that can be filtered by city, I'm also using Django paginator. My issue is how do I persist the filter when on another page?

example view.py not actual code..

event_list = Event.objects.filter(city=something)
paginator = Paginator(event_list, 1) # Show 25 contacts per page
Bibhas Debnath
  • 14,559
  • 17
  • 68
  • 96
Prometheus
  • 32,405
  • 54
  • 166
  • 302

1 Answers1

0

You need to manually pass the extra get variables which will be later used for filtering:

<a href="?page={{ paginator.next_page_number }}&my_filter_a={{ my_filter_a }}&my_filter_b={{ my_filter_b }}">Next</a>
Aamir Rind
  • 38,793
  • 23
  • 126
  • 164