Exemplo n.º 1
0
    def retrieve(self, request, **kwargs):
        store = Store.objects.get(pk=kwargs['pk'])
        store_info = StoreDetailSerializer(store, context={'request': request})

        qs = Product.objects.filter(store=store).annotate(
            average_rate=Avg('rates__rate')).order_by(
                F('average_rate').desc(nulls_first=True), '-create_date')

        queryset = SearchFilter().filter_queryset(request, qs, ProductView())

        page = self.paginate_queryset(queryset)
        if page is not None:
            serializer = self.get_serializer(page, many=True)
            return Response(
                OrderedDict([
                    ('count', self.paginator.page.paginator.count),
                    ('next', self.paginator.get_next_link()),
                    ('previous', self.paginator.get_previous_link()),
                    ('category_info', store_info.data),
                    ('results', serializer.data),
                ]))

        serializer = self.get_serializer(queryset, many=True)
        return Response(
            OrderedDict([
                ('category_info', store_info.data),
                ('posts', serializer.data),
            ]))
"""market_kurly URL Configuration

The `urlpatterns` list routes URLs to views. For more information please see:
    https://docs.djangoproject.com/en/3.1/topics/http/urls/
Examples:
Function views
    1. Add an import:  from my_app import views
    2. Add a URL to urlpatterns:  path('', views.home, name='home')
Class-based views
    1. Add an import:  from other_app.views import Home
    2. Add a URL to urlpatterns:  path('', Home.as_view(), name='home')
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.contrib import admin
from django.urls import path
from product.views import ProductView

urlpatterns = [
    path('admin/', admin.site.urls),
    path('product', ProductView.as_view()),
    path('product/<int:product_id>', ProductView.as_view())
]
Exemplo n.º 3
0
from django.conf.urls import include, url 
from product.views import ProductView, ProductDetailView
from product import views

urlpatterns = [  
    url(r'^products/$', ProductView.as_view(), name='products'),   
    url(r'^products/(?P<pk>[0-9]+)/$', ProductDetailView.as_view(), name='detail'),  
    url(r'^products/(?P<pk>[0-9]+)/change$', views.change , name='change'),   
]
Exemplo n.º 4
0
from django.urls import path, include
from product.views import ProductView

urlpatterns = [path('/<int:product_id>', ProductView.as_view())]
Exemplo n.º 5
0
"""product URL Configuration

The `urlpatterns` list routes URLs to views. For more information please see:
    https://docs.djangoproject.com/en/2.2/topics/http/urls/
Examples:
Function views
    1. Add an import:  from my_app import views
    2. Add a URL to urlpatterns:  path('', views.home, name='home')
Class-based views
    1. Add an import:  from other_app.views import Home
    2. Add a URL to urlpatterns:  path('', Home.as_view(), name='home')
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 . import views
from product.views import ProductView

app_name = 'product'
urlpatterns = [
    path('', ProductView.as_view(), name='home'),
    path('<slug:p_slug>/', views.detail, name='detail'),
]
Exemplo n.º 6
0
from django.urls import path

from product.views import ProductView, ChangeProductView, BrandView, EditBrandView, ColorView, EditColorView, \
    GetProductView, ProductCartView

urlpatterns = [
    path('<int:pk>', ProductView.as_view()),
    path('change_product/<int:pk>', ChangeProductView.as_view()),
    path('get_product/<int:pk>', GetProductView.as_view()),
    path('brand/', BrandView.as_view()),
    path('color/', ColorView.as_view()),
    path('brand/<int:pk>', EditBrandView.as_view()),
    path('color/<int:pk>', EditColorView.as_view()),
    path('cart/', ProductCartView.as_view()),
]
Exemplo n.º 7
0
from django.contrib import admin

from ozna.views import MainView

from contact.views import ContactView
from contact.views import ThanksView
from news.views import NewsView
from about.views import AboutView
from product.views import ProductView
from product.views import KtpView
from product.views import productdetail, ktpview, IndexView

from gear.views import GearView

from contact.views import contact, rssview

urlpatterns = [
    url(r'^pkf/', admin.site.urls),
    url(r'^$', IndexView.as_view(), name="main"),
    url(r'^contacts/$', ContactView.as_view(), name="contacts"),
    url(r'^news/$', NewsView.as_view(), name="news"),
    url(r'^about/$', AboutView.as_view(), name="about"),
    url(r'^product/$', ProductView.as_view(), name="product"),
    url(r'^product/(?P<service_id>\d+)/$', ktpview, name="ktp"),
    url(r'^gear/$', GearView.as_view(), name="gear"),
    url(r'^form/$', contact, name="form"),
    url(r'^thanks/$', ThanksView.as_view(), name="thanks"),
    url(r'^product/(?P<alias>[^/]+)/$', productdetail, name='productdetail'),
    url(r'^rss/$', MainView, name='rss'),
]
Exemplo n.º 8
0
from django.urls   import path
from product.views import ProductView, ProductDetailView, LikeView

urlpatterns = [
    path('', ProductView.as_view()),
    path('/<int:product_id>', ProductDetailView.as_view()),
    path('/<int:product_id>/like', LikeView.as_view()),

]
Exemplo n.º 9
0
from django.contrib import admin
from django.urls import path, include
from product.views import ProductView, ProductUpdateView, ProductDeleteView

urlpatterns = [
    path('/main', ProductView.as_view()),
    path('/update/<int:product_id>', ProductUpdateView.as_view()),
    path('/delete/<int:product_id>', ProductDeleteView.as_view()),
]
Exemplo n.º 10
0
from django.urls import path

from product.views import ProductView, ProductEditView

app_name = "product"
urlpatterns = [
    path("", ProductView.as_view(), name="index"),
    path("create", ProductEditView.as_view(), name="create"),
]
from django.urls import path
from product.views import PostView, ProductView, ProductDetailView, MenuView, BestProductView
urlpatterns = [
    path('/post', PostView.as_view()),
    path('/menu', MenuView.as_view()),
    path('/products_info', ProductView.as_view()),
    path('/<int:product_id>', ProductDetailView.as_view()),
    path('/best', BestProductView.as_view()),
]
Exemplo n.º 12
0
from supplier.views import SupplierOrgView, SupplierView
from article.views import ArticleView
from utils.context import Context

urlpatterns = [
    # Public pages
    path('catalog/lots/list/', CatalogLotsListView.as_view()),
    path('catalog/lots/<str:category>/', CatalogLotsView.as_view()),
    path('catalog/lots/<str:category>/<str:group>/',
         CatalogLotsView.as_view()),
    path('catalog/lots/<str:category>/<str:pargroup>/<str:group>/',
         CatalogLotsView.as_view()),
    path('catalog/lots/', CatalogLotsView.as_view()),
    path('catalog/groups/list/', CatalogGroupsListView.as_view()),
    path('lot/<str:alias>/', LotView.as_view()),
    path('product/<str:alias>/', ProductView.as_view()),
    path('brand/<str:alias>/', BrandView.as_view()),
    path('supplier/office/<str:alias>/', SupplierView.as_view()),
    path('supplier/<str:alias>/', SupplierOrgView.as_view()),
    path('article/<str:alias>/', ArticleView.as_view()),
    path('search/', SearchView.as_view()),
    path('tag/<str:tag>/', TagView.as_view()),

    # User
    path('register/done/', RegisterDoneView.as_view()),
    path('register/', RegisterView.as_view()),
    path(
        'login/',
        auth_views.LoginView.as_view(template_name='user/login.html',
                                     extra_context={"context":
                                                    Context.get()})),
Exemplo n.º 13
0
from django.contrib import admin
from django.urls import path
from customer.views import index, JoinView, LoginView, logout, CustomerListApiView, CustomerApiView
from order.views import OrderAddView, OrderListView, OrderListApiView, OrderApiView
from product.views import ProductListView, ProductAddView, ProductView, ProductListApiView, ProductApiView

urlpatterns = [
    path("s/a/console/", admin.site.urls),
    path('', index),
    path("join/", JoinView.as_view()),
    path("login/", LoginView.as_view()),
    path("logout/", logout),
    path("product/", ProductListView.as_view()),
    path("product/add", ProductAddView.as_view()),
    path("product/<int:pk>", ProductView.as_view()),
    path("order/", OrderListView.as_view()),
    path("order/add", OrderAddView.as_view()),
    path("api/product", ProductListApiView.as_view()),
    path("api/product/<int:pk>", ProductApiView.as_view()),
    path("api/customer", CustomerListApiView.as_view()),
    path("api/customer/<int:pk>", CustomerApiView.as_view()),
    path("api/order", OrderListApiView.as_view()),
    path("api/order/<int:pk>", OrderApiView.as_view()),
]
Exemplo n.º 14
0
from django.urls import path

from product.views import CategoryListView, CategoryView, ProductListView, ProductView, ProductsView

# prefix category/
urlpatterns = [
    path('', CategoryListView.as_view()),
    path('<int:pk>/', CategoryView.as_view()),
    path('<int:pk>/product/', ProductListView.as_view()),
    path('<int:pk2>/product/<int:pk>/', ProductView.as_view()),
    path('all/', ProductsView.as_view()),
]
Exemplo n.º 15
0
"""recycle URL Configuration

The `urlpatterns` list routes URLs to views. For more information please see:
    https://docs.djangoproject.com/en/3.0/topics/http/urls/
Examples:
Function views
    1. Add an import:  from my_app import views
    2. Add a URL to urlpatterns:  path('', views.home, name='home')
Class-based views
    1. Add an import:  from other_app.views import Home
    2. Add a URL to urlpatterns:  path('', Home.as_view(), name='home')
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.contrib import admin
from django.urls import path
from user.views import index, RegisterView, LoginView
from product.views import ProductView

urlpatterns = [
    path('admin/', admin.site.urls),
    path('', index),
    path('register/', RegisterView.as_view()),
    path('login/', LoginView.as_view()),
    path('product/', ProductView.as_view()),
]
Exemplo n.º 16
0
from django.contrib import admin
from django.urls import path,include
from product.views import ProductView,ProductSelectView,get_product
from django.views.static import serve


from django.conf.urls import url
import xadmin

urlpatterns = [
    path('product/<str:search>',ProductView.as_view(),name='product'),
    path('product_select/', ProductSelectView.as_view(), name='product_select'),
    path('get_product/',get_product,name='get_product'),
]
Exemplo n.º 17
0
from django.conf.urls import url,include
from django.contrib import admin
from product.views import ProductView,List3View,DetailProductView,KidsView
from product import views

from django.conf.urls.static import static
from django.contrib.staticfiles.urls import staticfiles_urlpatterns
from django.conf import settings
#from django.contrib.auth import views as auth_views


appname="product"
urlpatterns=[
	url(r'^product/',ProductView.as_view(),name='product'),
	
	url(r'^list3/',List3View.as_view(),name='list3'),
	url(r'^details/(?P<pk>[0-9]+)/$',DetailProductView.as_view(),name='details'),
	url(r'^paypal/', include('paypal.standard.ipn.urls')),
	#url(r'^pay1/',PayView.as_view(),name='pay1'),
	url(r'^payment/$', views.payment, name="payment"),
        url(r'^payment/success$', views.payment_success, name="payment_success"),
        url(r'^payment/failure$', views.payment_failure, name="payment_failure"),
	url(r'^kids/',KidsView.as_view(),name="kids"),


]

urlpatterns+=static(settings.MEDIA_URL,document_root=settings.MEDIA_ROOT)
#urlpatterns+=static(settings.STATIC_URL,document_root=settings.STATIC_ROOT)