While trying to build my first django project, I am stuck at passing values for product filtering. Every feature which has value 1 passed to it, will be an active filter, and others will be 0, i.e. inactive. urls.py:
urlpatterns=[
path('women/<str:category>/filter?pricefrom=<int:min>&to=<int:max>&size?s=<int:s>&m=<int:m>&l=<int:l>&xl=<int:xl>&xxl=<int:xxl>&xxxl=<int:xxxl>&color?blue=<int:blue>&red=<int:red>&yellow=<int:yellow>&black=<int:black>&white=<int:white>&green=<int:green>&brown=<int:brown>',views.women_category,name='women category page with filters'),
]
views.py:
def women_category(request,category,id=None,flag=None,min=None,max=None,s=None,m=None,l=None,xl=None,xxl=None,xxxl=None,blue=None,red=None,yellow=None,black=None,white=None,green=None,brown=None):
#product filter logics here
I want that the user should be able to use any possible combination of filters, with the filters being: Price: min,max Size: S,M,L,XL,XXL,XXXL color:yellow,blue,green,...etc
I don't know how to use Regex in urls, so please help me convert my url into a regex url so that all filter variables are optional to be passed through the fronted.