I was looking for this question and could not find it, sorry if it is duplicated.
I am creating an e-commerce site similar to ebay. The problem occurs when I try to view the "categories" and "filters". For instance. You can view the "Monitor" category. This will show you a lot of monitors and some filters (exactly the same as ebay) to apply them. So, you go to the "monitors", then you have filters like:
- Type: LCD - LED - CRT
- Brand Name: ViewSonic - LG - Samsung
- Maximum resolution: 800x600 - 1024x768
And these filters will be added to the URL, following the example when you are viewing monitors, the URL might look something like this:
store.com/monitors
If you apply the Type filter:
store.com/monitors/LCD
"Mark":
store.com/monitors/LCD/LG
"Maximum Resolution":
store.com/monitors/LCD/LG/1024x768
So, to summarize, the URL structure will look something like this:
/category/filter1/filter2/filter3
I canβt figure out how to do this. The problem is that filters can be variables. I think the view will need to use **kwargs
, but I'm not sure.
Do you have any idea how to fix such parameters?
Thanks a lot!
source share