本,我希望这能帮助你
urls.py
from catalog.views import catalog_products_view
urlpatterns = patterns(
'',
url(r'^(?P<category>[\w-]+)/$', catalog_products_view, name="catalog_products_view"),
url(r'^(?P<category>[\w-]+)/(?P<filter1>[\w-]+)/$', catalog_products_view, name="catalog_products_view"),
url(r'^(?P<category>[\w-]+)/(?P<filter1>[\w-]+)/(?P<filter2>[\w-]+)/$', catalog_products_view, name="catalog_products_view"),
url(r'^(?P<category>[\w-]+)/(?P<filter1>[\w-]+)/(?P<filter2>[\w-]+)/(?P<filter3>[\w-]+)/$', catalog_products_view, name="catalog_products_view"),
)
view.py
def catalog_products_view(request, category, filter1=None, filter2=None, filter3=None):
# some code here
or
def catalog_products_view(request, category, **kwargs):
filter1 = kwargs['filter1']
filter2 = kwargs['filter2']
....
filterN = kwargs['filterN']
# some code here