O'Reilly logo

Django Project Blueprints by Asad Jibran Ahmed

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Searching with aggregations

The user interaction that we would like to have is this: the user opens the search page or does a search and sees the list of category links. The user then clicks on one of those links and sees only products from those categories, with the user's previous search applied. So if the user searched for products with price between 100 and 200 and then clicked on one of the category links, the new search should show only products from that category while still applying the price filtering.

In order to achieve this, we need a way to create the category links so that the current search is preserved. We can pass the category to HomeView as another GET parameter. So we need to take the current GET parameters (which make up the ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required