M
M
mefisto6612019-12-29 13:50:40
Python
mefisto661, 2019-12-29 13:50:40

How to implement page content filtering and sorting in FLask?

There is an online store. All products are displayed on the main page. I am making a form to filter content (price range, popularity, date, delivery time, etc.) The POST form is sent to the view for the main page, the render_template page returns a filtered list of objects. When the page is reloaded, as expected, a warning pops up about resubmitting the form. How can this be fixed (except for ajax`a)?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vladimir, 2019-12-29
@mefisto661

Send via GET, usually they do this if there is simple logic, for example /products?price=desc&from_date=etc

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question