0
votes

I'm building a order management system in Django with a dashboard displaying some relevant information about the different stages of all orders. I have some counters displaying for example the number of quotes older than 30 days.

This is done by defining the queryset filtering only orders on stage "Quote" and older than 30 days, I then update the context with the .count of this QS so I can access it in the template. I have a bunch of these counters with different filters (multiple) filter on each.

What I would like to do is make this counter a button that send you to a new ListView page that displays a list of all orders matching the QS. I suppose I need to pass some kind of ID or text with each button in the URL that can be used in the views.py for the ListView to decide which QS to apply. But I cannot figure out how.

I have tried searching for an answer, but I can only find examples to pass a single filter with the URL. I would rather use a shorter ID or string in the URL, and only define the full QS in views.py

I feel like this should be a pretty easy and common use case, but I'm using the wrong keywords when searching... Any pointers to examples or where in the docs to read would be greatly appreciated!