Exemplo n.º 1
0
from django.conf.urls import include, url
from django.contrib import admin

from products.views import (
		ProductCreateView,
		ProductUpdateView,
		SellerProductListView
	)


from .views import (
        SellerDashboard,
        SellerProductDetailRedirectView,
        SellerTransactionListView,

        )

urlpatterns = [
    url(r'^$', SellerDashboard.as_view(), name='dashboard'),
    url(r'^transactions/$', SellerTransactionListView.as_view(), name='transactions'),
    url(r'^products/$', SellerProductListView.as_view(), name='product_list'), #sellers:product_list
    url(r'^products/(?P<pk>\d+)/$', SellerProductDetailRedirectView.as_view()),
    url(r'^products/(?P<pk>\d+)/edit/$', ProductUpdateView.as_view(), name='product_edit'),
    url(r'^products/add/$', ProductCreateView.as_view(), name='product_create'),
]   
Exemplo n.º 2
0
from django.urls import path

from products.views import ProductDetailView, ProductListView, ProductCreateView, ProductUpdateView, ProductDeleteView, \
    ProductDownloadView

app_name = "products"
urlpatterns = [
    path('', ProductListView.as_view(), name="index"),
    path('<int:pk>', ProductDetailView.as_view(), name="detail"),
    path('<slug:slug>', ProductDetailView.as_view(), name="detail_slug"),
    path('<int:id>/download', ProductDownloadView.as_view(), name="download"),
    path('<slug:slug>/download',
         ProductDownloadView.as_view(),
         name="download_slug"),
    path('create/', ProductCreateView.as_view(), name="create"),
    path('<int:pk>/edit', ProductUpdateView.as_view(), name="update"),
    path('<slug:slug>/edit', ProductUpdateView.as_view(), name="update_slug"),
    path('<int:pk>/delete', ProductDeleteView.as_view(), name="delete"),
    path('<slug:slug>/delete', ProductDeleteView.as_view(),
         name="delete_slug"),
]
Exemplo n.º 3
0
from django.urls import path

# Импортируем свою функцию
from products.views import (ProductCreateView, ProductUpdateView,
                            ProductDeleteView, ProductListView,
                            ProductDetailView, product_list, product_detail,
                            product_create, product_update, product_delete)

app_name = 'products'

urlpatterns = [
    path('<int:pk>/delete/', ProductDeleteView.as_view(), name='delete'),
    path('<int:pk>/update/', ProductUpdateView.as_view(), name='update'),
    # path('create/', product_create, name='create'),
    path('create/', ProductCreateView.as_view(), name='create'),
    path('<int:pk>/', ProductDetailView.as_view(), name='detail'),
    path('', ProductListView.as_view(), name='catalog'),
]
Exemplo n.º 4
0
"""
from django.conf.urls import include, url
from django.contrib import admin

from products.views import (
        ProductCreateView,
        ProductDetailView,       
        ProductListView,
        ProductUpdateView,

        )

urlpatterns = [
    url(r'^admin/', include(admin.site.urls)),
    url(r'^create/$', 'products.views.create_view', name='create_view'),
    url(r'^detail/(?P<object_id>\d+)/edit/$', 'products.views.update_view', name='update_view'),

    url(r'^detail/(?P<object_id>\d+)/$', 'products.views.detail_view', name='detail_view'),
    url(r'^detail/(?P<slug>[/w-]+)/$', 'products.views.detail_slug_view', name='detail_slug_view'),
    url(r'^list/$', 'products.views.list_view', name='list_view'),
    url(r'^products/$', ProductListView.as_view(), name='product_list_view'),
    url(r'^products/add/$', ProductCreateView.as_view(), name='product_create_view'),
    url(r'^products/(?P<slug>[\w-]+)/$', ProductDetailView.as_view(), name='product_detail_slug_view'),  
    url(r'^products/(?P<pk>\d+)/$', ProductDetailView.as_view(), name='product_detail_view'),
    url(r'^products/(?P<pk>\d+)/edit/$', ProductUpdateView.as_view(), name='product_update_view'),  
    url(r'^products/(?P<slug>[\w-]+)/edit/$', ProductUpdateView.as_view(), name='product_update_view'),    



]
Exemplo n.º 5
0
from products.views import (
    ProductCreateView,
    SellerProductListView,
    ProductUpdateView,
)

# Import views from seller app to process url

from .views import (
    SellerDashboard,
    SellerTransactionListView,
    SellerProductDetailRedirectView,
)

# Url setup for seller

urlpatterns = [
    url(r'^$', SellerDashboard.as_view(), name='dashboard'),
    url(r'^transactions/$',
        SellerTransactionListView.as_view(),
        name='transactions'),
    url(r'^products/$', SellerProductListView.as_view(), name='product_list'),
    url(r'^products/(?P<pk>\d+)/$', SellerProductDetailRedirectView.as_view()),
    url(r'^products/(?P<pk>\d+)/edit/$',
        ProductUpdateView.as_view(),
        name='product_edit'),
    url(r'^products/add/$', ProductCreateView.as_view(),
        name='product_create'),
]
Exemplo n.º 6
0
Including another URLconf
    1. Import the include() function: from django.urls import include, path
    2. Add a URL to urlpatterns:  path('blog/', include('blog.urls'))
"""
from django.urls import path


from products.views import (
    products,
    product_view,
    product_create_view,
    product_update_view,
    product_delete_view,
    ProductListView,
    ProductDetailView,
    ProductCreateView,
    ProductUpdateView,
    ProductDeleteView

)

app_name = 'products'

urlpatterns = [
    path('', ProductListView.as_view(), name='products'),
    path('create/', ProductCreateView.as_view(), name='create'),
    path('<str:slug>/', ProductDetailView.as_view(), name='view'),
    path('<str:slug>/update/', ProductUpdateView.as_view(), name='update'),
    path('<str:slug>/delete/', ProductDeleteView.as_view(), name='delete'),
]
Exemplo n.º 7
0
api_urls = [
    path('products/', include(('products.urls', 'products'), namespace='products')),
    path('categories/', include(('categories.urls', 'categories'), namespace='categories')),
    path(
        'shopping_baskets/',
        include(('shopping_baskets.urls', 'shopping_baskets'), namespace='shopping_baskets')
    ),
]

ui_urls = [
    path('categories/<int:category_id>/products/add/', ProductCreateView.as_view(),
         name='product-create-ui'),
    path('categories/<int:category_id>/products/<int:pk>/', ProductDetail.as_view(),
         name='products-detail'),
    path('categories/<int:category_id>/products/<int:pk>/edit/', ProductUpdateView.as_view(),
         name='product-edit'),
    path(
        'categories/<int:category_id>/products/<int:pk>/delete/',
        ProductDeleteView.as_view(),
        name='product-delete'
    ),
    path('categories/<int:category_id>/products/', ProductList.as_view(), name='products'),
    path('categories/add/', CategoryCreateView.as_view(), name='category-create-ui'),
    path('categories/<slug:pk>/edit/', CategoryUpdateView.as_view(),
         name='category-edit'),
    path('categories/<int:pk>/delete/', CategoryDeleteView.as_view(),
         name='category-delete'),
    path('shopping-basket/', ShoppingBasketView.as_view(), name='shopping-basket-ui'),
    path('order-success/', OrderSuccess.as_view(), name='order-success'),
    path('order/', OrderCreate.as_view(), name='order-create'),
Exemplo n.º 8
0
from django.conf.urls import url
from django.contrib import admin

import products.views
from   products.views import (
    ProductCreateView,
    ProductDetailView,
    ProductDownloadView,
    ProductListView,
    ProductUpdateView,
    )

urlpatterns = [
    url(r'^admin/', admin.site.urls),
    url(r'^$',ProductListView.as_view(),name='list'),
    url(r'^add/$',ProductCreateView.as_view(),name='create'),
    url(r'^(?P<pk>\d+)$',ProductDetailView.as_view(),name='detail'),
    url(r'^(?P<pk>\d+)/download/$',ProductDownloadView.as_view(),name='download'),
    url(r'^(?P<pk>\d+)/edit/$',ProductUpdateView.as_view(),name='update'),
    url(r'^(?P<slug>[\w.@+-]+)/$',ProductDetailView.as_view(),name='detail_slug'),
    url(r'^(?P<slug>[\w.@+-]+)/download/$',ProductDownloadView.as_view(),name='download_slug'),
    url(r'^(?P<slug>[\w.@+-]+)/edit/$',ProductUpdateView.as_view(),name='update_slug'),
]
Exemplo n.º 9
0
from products.views import ProductListView, ProductDetailView, ProductCreateView, ProductUpdateView, ProductDeleteView
from carts.views import CartView, CheckoutView, CheckoutFinalView
from orders.views import AddressSelectFormView, UserAddressCreateView, OrderList, OrderDetail

urlpatterns = [
    url(r"^$", TemplateView.as_view(template_name = "index.html"), name="index"),
    url(r'^admin/', admin.site.urls),
    url(r'^accounts/', include('allauth.urls')),

    url(r'^products/$',
        ProductListView.as_view(), name = "products_list_view"),
    url(r'^create/product$',
        ProductCreateView.as_view(), name = "products_create_view"),
    url(r'^update/product/(?P<pk>\d+)$',
        ProductUpdateView.as_view(), name = "products_update_view"),
    url(r'^delete/product/(?P<pk>\d+)$',
        ProductDeleteView.as_view(), name = "products_delete_view"),
    url(r'^products/(?P<pk>\d+)$',
        ProductDetailView.as_view(), name = "products_detail_view"),
    url(r'^products/(?P<slug>[\w-]+)$',
        ProductDetailView.as_view(), name = "products_slug_view"),

    url(r'^cart/$', CartView.as_view(), name = "cart"),

    url(r'^orders/$', OrderList.as_view(), name = "orders"),
    url(r'^orders/(?P<pk>\d+)$', OrderDetail.as_view(), name = "order_detail"),

    url(r'^checkout/$', CheckoutView.as_view(), name = "checkout"),
    url(r'^checkout/address/$',
        AddressSelectFormView.as_view(), name = "address_form"),
Exemplo n.º 10
0
from django.contrib import admin
from django.urls import path

from products.views import (
    ProductCreateView,
    ProductDetailView,
    ProductDeleteView,
    ProductUpdateView,
    ProductListView

)

app_name = 'products'
urlpatterns = [

    path('product/create/', ProductCreateView.as_view(), name='product-create'),
    path('product/<int:id>/', ProductDetailView.as_view(), name='product-detail'),
    path('product/<int:id>/update/', ProductUpdateView.as_view(), name='product-update'),
    path('product/<int:id>/delete/', ProductDeleteView.as_view(), name='product-delete'),
    path('', ProductListView.as_view(), name='product-list')

]
Exemplo n.º 11
0
from django.contrib import admin
from django.urls import path, include
from products.views import (ProductListView, ProductDetailView,
                            ProductCreateView, ProductDeleteView,
                            ProductUpdateView, ProductView, RawCreateClass,
                            RawUpdateClass)

app_name = "products"
urlpatterns = [
    path("list/", ProductListView.as_view(), name="display_product_list"),

    #path("list/<int:lo>",ProductDetailView.as_view(),name="product_details"),
    path("create/", ProductCreateView.as_view(), name="create_product"),

    #path("delete/<int:lo>",ProductDeleteView.as_view(),name="product_delete"),
    path("update/<int:lo>", ProductUpdateView.as_view(),
         name="update_product"),

    #path("ftc/<int:lo>",ProductView.as_view(),name="viewa_product"),

    #path("ftc/",ProductView.as_view(template_name="products/product_list.html"),name="viewb_product"),

    #path("raw_create_class/",RawCreateClass.as_view(template_name="form.html"),name="viewc_product"),

    #path("raw_update_class/<int:lo>",RawUpdateClass.as_view(template_name="form.html"),name="viewd_product")
]
Exemplo n.º 12
0
from django.urls import path
from django.views.generic.base import RedirectView
from products.views import (
    ProductCreateView,
    ProductDetailView,
    # ProductDownloadView,
    ProductListView,
    ProductUpdateView,
    ProductRatingAjaxView,
    VendorListView,
)

urlpatterns = [
    path('', ProductListView.as_view(), name='list'),
    path('vendor/',
         RedirectView.as_view(pattern_name='products:list'),
         name='vendor_list'),
    path('vendor/<vendor_name>',
         VendorListView.as_view(),
         name='vendor_detail'),
    path('ajax/rating/', ProductRatingAjaxView.as_view(), name='ajax_rating'),
    path('<int:pk>/', ProductDetailView.as_view(), name='detail'),
    path('<slug:slug>/', ProductDetailView.as_view(), name='detail_slug'),
    path('<int:pk>/edit/', ProductUpdateView.as_view(), name='update'),
    path('<slug:slug>/edit/', ProductUpdateView.as_view(), name='update_slug'),
]