Exemplo n.º 1
0
 path('', IndexView.as_view(), name='index'),
 path('echo/', json_echo_view),
 path('get_token/', get_token_view),
 path(
     'product/',
     include([
         path('add/', ProductCreateView.as_view(), name='product_create'),
         path(
             '<int:pk>/',
             include([
                 path('', ProductView.as_view(), name='product_view'),
                 path('update/',
                      ProductUpdateView.as_view(),
                      name='product_update'),
                 path('delete/',
                      ProductDeleteView.as_view(),
                      name='product_delete'),
                 path('add-to-cart/',
                      CartAddView.as_view(),
                      name='product_add_to_cart'),
             ])),
     ])),
 path(
     'cart/',
     include([
         path('', CartView.as_view(), name='cart_view'),
         path(
             '<int:pk>/',
             include([
                 path('delete/',
                      CartDeleteView.as_view(),
Exemplo n.º 2
0
    ProductUpdateView, ProductDeleteView, CartView, CartAddView, \
    CartDeleteView, CartDeleteOneView, OrderCreateView


app_name = 'webapp'


urlpatterns = [
    path('', IndexView.as_view(), name='index'),

    path('product/', include([
        path('add/', ProductCreateView.as_view(), name='product_create'),
        path('<int:pk>/', include([
            path('', ProductView.as_view(), name='product_view'),
            path('update/', ProductUpdateView.as_view(), name='product_update'),
            path('delete/', ProductDeleteView.as_view(), name='product_delete'),
            path('add-to-cart/', CartAddView.as_view(), name='product_add_to_cart'),
        ])),
    ])),

    path('cart/', include([
        path('', CartView.as_view(), name='cart_view'),
        path('<int:pk>/', include([
            path('delete/', CartDeleteView.as_view(), name='cart_delete'),
            path('delete-one/', CartDeleteOneView.as_view(), name='cart_delete_one'),
        ])),
    ])),

    path('order/create/', OrderCreateView.as_view(), name='order_create'),
]
Exemplo n.º 3
0
from django.urls import path

from webapp.views import IndexView,  ReviewCreateView, ReviewUpdateView, ReviewDeleteView, ProductView, \
    ProductCreateView, ProductUpdateView, ProductDeleteView

app_name = 'webapp'

urlpatterns = [
    path('', IndexView.as_view(), name='index'),
    path('review/<int:pk>/add_review/', ReviewCreateView.as_view(), name='review_create'),
    path('review/<int:pk>/update/', ReviewUpdateView.as_view(), name='review_update'),
    path('review/<int:pk>/delete/', ReviewDeleteView.as_view(), name ='review_delete'),
    path('product/<int:pk>/', ProductView.as_view(), name='product_view'),
    path('product/add/', ProductCreateView.as_view(), name='product_create'),
    path('product/<int:pk>/update/', ProductUpdateView.as_view(), name='product_update'),
    path('product/<int:pk>/delete/', ProductDeleteView.as_view(), name='product_delete'),
]
Exemplo n.º 4
0
from django.urls import path

from webapp.views import (
    ProductList,
    ProductCreate,
    ProductDeleteView,
    ProductUpdateView,
    ProductView,
    ReviewDeleteView,
    ReviewUpdateView,
    ReviewCreate,

)

app_name = 'product'

urlpatterns = [
    path('', ProductList.as_view(), name='list'),
    path('<int:pk>/', ProductView.as_view(), name='view'),
    path('<int:pk>/update/', ProductUpdateView.as_view(), name='update'),
    path('<int:pk>/delete/', ProductDeleteView.as_view(), name='delete'),
    path('project/add/', ProductCreate.as_view(), name='add'),
    path('<int:pk>/add/review/', ReviewCreate.as_view(), name='review_add'),

    path('review/<int:pk>/update/', ReviewUpdateView.as_view(), name='review_update'),
    path('review/<int:pk>/delete/', ReviewDeleteView.as_view(), name='review_delete'),


]
Exemplo n.º 5
0
from webapp.views import (
    ProductsView,
    ProductReviewsView,
    ProductCreateView,
    ProductDeleteView,
    ProductUpdateView,
    ReviewCreateView,
    ReviewUpdateView,
    ReviewDeleteView,
)

urlpatterns = [
    path('', ProductsView.as_view(), name='product_list'),
    path('<int:pk>', ProductReviewsView.as_view(), name='product_detail'),
    path('create/', ProductCreateView.as_view(), name='product_create'),
    path('<int:pk>/delete', ProductDeleteView.as_view(),
         name='product_delete'),
    path('<int:pk>/update/',
         ProductUpdateView.as_view(),
         name='product_update'),
    path('<int:pk>/reviews/create',
         ReviewCreateView.as_view(),
         name='review_create'),
    path('reviews/<int:pk>/update',
         ReviewUpdateView.as_view(),
         name='review_update'),
    path('reviews/<int:pk>/delete',
         ReviewDeleteView.as_view(),
         name='review_delete'),
]