You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
16 lines
619 B
16 lines
619 B
import mptt_urls
|
|
from django.urls import re_path, path
|
|
|
|
from . import views
|
|
from .models import ProductCategory, Product
|
|
|
|
urlpatterns = [
|
|
path('list/', views.ProductListView.as_view(), name='product_list'),
|
|
re_path(r'^list/(?P<path>.*)',
|
|
mptt_urls.view(model=ProductCategory, view=views.ProductListView.as_view(), slug_field='slug'),
|
|
name='product_list'
|
|
), re_path(r'^item/(?P<path>.*)',
|
|
mptt_urls.view(model=Product, view=views.ProductDetailView.as_view(), slug_field='slug'),
|
|
name='product_details'
|
|
),
|
|
]
|
|
|