Пример #1
0
 def get(self,*args,**kwargs):
     #获取一级分类
     #循环一级分类,获取二级分类
     #循环二级分类,获取三级分类
     c=CategoryService(CategoryRepository())
     category_list=c.fetch_all_category()
     p=ProductService(ProductRepository())
     product_dict=p.fetch_index_product()
Пример #2
0
    def get(self, *args, **kwargs):
        # 获取一级分类
        # 循环一级分类,获取二级分类
        # 循环二级分类,获取三级分类
        c = CategoryService(CategoryRepository())
        category_list = c.get_all_category()

        p = ProductService(ProductRepository())
        product_dict = p.fetch_index_product()

        self.render('Home/Index.html',
                    category_list=category_list,
                    product_dict=product_dict)