Ejemplo n.º 1
0
from django.urls import path
from webapp.views import (
    IndexProducts,
    ProductView,
    ProductCreate,
    ProductUpdate,
    ProductDelete,
)
from webapp.views.reviews import AddReview, ReviewUpdate, ReviewDelete

app_name = 'products'

urlpatterns = [
    path('', IndexProducts.as_view(), name='index_products'),
    path('product/<int:pk>/', ProductView.as_view(), name='product_view'),
    path('product/add/', ProductCreate.as_view(), name='product_add'),
    path('product/<int:pk>/update/',
         ProductUpdate.as_view(),
         name='product_update'),
    path('product/<int:pk>/delete/',
         ProductDelete.as_view(),
         name='product_delete'),
    path('product/<int:pk>/review_add/',
         AddReview.as_view(),
         name='review_add'),
    path('review/<int:pk>/update/',
         ReviewUpdate.as_view(),
         name='review_update'),
    path('review/<int:pk>/delete/',
         ReviewDelete.as_view(),
         name='review_delete'),
Ejemplo n.º 2
0
from django.urls import path
from webapp.views import (
    ProductView,
    ProductDetailView,
    ProductCreate,
    ProductUpdate,
    ProductDelete,
    ReviewCreateView,
    ReviewUpdateView,
    ReviewDelete,
)

urlpatterns = [
    path('', ProductView.as_view(), name='index_all'),
    path('product/<int:id>/', ProductDetailView.as_view(), name='product'),
    path('product/create/', ProductCreate.as_view(), name='product_create'),
    path('product/<int:id>/update',
         ProductUpdate.as_view(),
         name='product_update'),
    path('product/<int:id>/delete',
         ProductDelete.as_view(),
         name='product_delete'),
    path('product/<int:id>/review/add/',
         ReviewCreateView.as_view(),
         name='review_add'),
    path('review/<int:id>/update/',
         ReviewUpdateView.as_view(),
         name='review_update'),
    path('review/<int:id>/delete/',
         ReviewDelete.as_view(),
         name='review_delete'),
Ejemplo n.º 3
0
    CartDeleteView, CartDeleteOneView, OrderCreateView, WatchOrdersView

app_name = 'webapp'

urlpatterns = [
    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'),
Ejemplo 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'),


]
Ejemplo n.º 5
0
from django.contrib import admin
from django.urls import path
from django.conf import settings
from django.conf.urls.static import static
from webapp.views import IndexView, ProductView, ProductUpdateView, ProductCreateView, ProductDeleteView, \
    OtzivCreateView, OtzivUpdateView, OtzivDeleteView

app_name = 'webapp'

urlpatterns = [
    path('admin/', admin.site.urls),
    path('', IndexView.as_view(), name='index'),
    path('products/<int:pk>/', ProductView.as_view(), name='product_detail'),
    path('products/<int:pk>/update/',
         ProductUpdateView.as_view(),
         name='product_update'),
    path('products/create/',
         ProductCreateView.as_view(),
         name='product_create'),
    path('products/<int:pk>/delete/',
         ProductDeleteView.as_view(),
         name='product_delete'),
    path('otziv/<int:pk>/create/',
         OtzivCreateView.as_view(),
         name='otziv_create'),
    path('otziv/<int:pk>/update/',
         OtzivUpdateView.as_view(),
         name='otziv_update'),
    path('otziv/<int:pk>/delete/',
         OtzivDeleteView.as_view(),
         name='otziv_delete'),
Ejemplo n.º 6
0
from django.urls import path

from webapp.views import IndexView, ProductView, UpdateProfileView, ChangePasswordView

app_name = 'webapp'

urlpatterns = [
    path('', IndexView.as_view(), name='index'),
    path('products/', ProductView.as_view({'get': 'list'})),
    path('update_profile/<int:pk>/',
         UpdateProfileView.as_view(),
         name='auth_update_profile'),
    path('change_password/<int:pk>/',
         ChangePasswordView.as_view(),
         name='auth_change_password'),
]