def get(self, request, *args, **kwargs):
        table = dict()
        table['headers'] = ["Title", "Slug", "Depth", "Parent","Actions"]
        table['fields'] = ["title", "slug", "depth", "parent", "admin/shop/category_table_actions.html"]
        category_list = shop_models.ProductCategories.objects.all()
        page_no = request.GET.get('page')
        page_size = 10
        table["data"] = helpers.paginate(category_list,page_no,page_size)

        return  render(request, "admin/shop/categories.html",{
        'table':table,
        })
    def get(self, request, *args, **kwargs):
        table = dict()
        table['headers'] = ["Name", "Code", "User","Actions"]
        table['fields'] = ["name", "code", "user", "admin/shop/vendor_table_actions.html"]
        items_list = shop_models.Vendors.objects.all()
        page_no = request.GET.get('page')
        page_size = 10
        table["data"] = helpers.paginate(items_list,page_no,page_size)

        return  render(request, "admin/shop/vendors.html",{
        'table':table,
        })
Esempio n. 3
0
    def get(self, request, *args, **kwargs):
        table = dict()
        table['headers'] = ["Name", "Code", "User","Actions"]
        table['fields'] = ["name", "code", "user", "admin/shop/vendor_table_actions.html"]
        items_list = shop_models.Vendors.objects.all()
        page_no = request.GET.get('page')
        page_size = 10
        table["data"] = helpers.paginate(items_list,page_no,page_size)

        return  render(request, "admin/shop/vendors.html",{
        'table':table,
        })
Esempio n. 4
0
    def get(self, request, *args, **kwargs):
        table = dict()
        table['headers'] = ["Title", "Slug", "Depth", "Parent","Actions"]
        table['fields'] = ["title", "slug", "depth", "parent", "admin/shop/category_table_actions.html"]
        category_list = shop_models.ProductCategories.objects.all()
        page_no = request.GET.get('page')
        page_size = 10
        table["data"] = helpers.paginate(category_list,page_no,page_size)

        return  render(request, "admin/shop/categories.html",{
        'table':table,
        })
    def get(self, request, *args, **kwargs):
        table = dict()
        table['headers'] = ["Name", "Product Code", "Serial number", "Date", "Actions"]
        table['fields'] = ["name", "product_code", "serial_number", "date_added", "admin/shop/product_table_actions.html"]

        product_list = shop_models.Product.objects.all()
        page_no = request.GET.get('page')
        page_size = 10
        table["data"] = helpers.paginate(product_list,page_no,page_size)

        return  render(request, "admin/shop/products.html",{
        'table':table,
        })
Esempio n. 6
0
    def get(self, request, *args, **kwargs):
        table = dict()
        table['headers'] = ["Name", "Product Code", "Serial number", "Date", "Actions"]
        table['fields'] = ["name", "product_code", "serial_number", "date_added", "admin/shop/product_table_actions.html"]

        product_list = shop_models.Product.objects.all()
        page_no = request.GET.get('page')
        page_size = 10
        table["data"] = helpers.paginate(product_list,page_no,page_size)

        return  render(request, "admin/shop/products.html",{
        'table':table,
        })
Esempio n. 7
0
 def get(self, request, *args, **kwargs):
     products = shop_models.Product.objects.all()
     if request.GET.get('cat'):
         try:
             products = products.filter(category=int(request.GET.get('cat')))
         except:
             pass
     categories = shop_models.ProductCategories.objects.all()
     page_no = request.GET.get('page')
     page_size = 10
     queryset = helpers.paginate(products,page_no,page_size)
     return  shortcuts.render(request, "shop/product_list.html",{
     'queryset':queryset,
     'categories':categories,
     })
Esempio n. 8
0
 def get(self, request, *args, **kwargs):
     products = shop_models.Product.objects.all()
     if request.GET.get('cat'):
         try:
             products = products.filter(
                 category=int(request.GET.get('cat')))
         except:
             pass
     categories = shop_models.ProductCategories.objects.all()
     page_no = request.GET.get('page')
     page_size = 10
     queryset = helpers.paginate(products, page_no, page_size)
     return shortcuts.render(request, "shop/product_list.html", {
         'queryset': queryset,
         'categories': categories,
     })