R
R
Roman Kitaev2015-05-28 19:26:01
Django
Roman Kitaev, 2015-05-28 19:26:01

Pagination with django filters?

Hello!
It was necessary to make filters for the QuerySet based on the GET request parameters that are sent by the form. But the trouble is that there is pagination, which, preferably, should also be tied to GET parameters. For the first page, the filters work and the URL looks like this:
http://site.ru/category/?filter=value
When you go to the second page, the filters, of course, go astray:
http://site.ru/category/?page=2
But I would like the filters to remain:
http://site.ru/category/?page=2&filter=value
Is there any more or less concise (perhaps already built-in) solution?
Stackoverflow and others recommend very ugly solutions.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
marazmiki, 2015-05-28
@marazmiki

Good old django-pagination will save, despite the fact that it has not been updated for five years :)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question