def index(): cat = Category() brd = Brand() arr = Product() a = arr.getProducts() b = brd.getBrands() c = cat.getCategories() return render_template('home/index.html', arr=a, brr=b, crr=c)
def detail(id): cat = Category() brand = Brand() pro = Product() a = pro.getProductById(id) b = brand.getBrands() c = cat.getCategories() d = pro.getProductsRelation(id) return render_template('home/detail.html', u=a, crr=c, brr=b, arr=d)
def brand(id): cat = Category() brand = Brand() pro = Product() a = pro.getProductsByBrand(id) b = brand.getBrands() c = cat.getCategories() d = brand.getBrandById(id) return render_template('home/brand.html', arr=a, crr=c, brr=b, title=d[1])
def index(p=1): cat = Category() brand = Brand() pro = Product() a = pro.getProductsForHome(p, 8) b = brand.getBrands() c = cat.getCategories() total = pro.homeCount() n = ceil(total / 8) return render_template('home/index.html', arr=a, crr=c, brr=b, title="Mobile Store", n=n)
def search(p=1): q = request.args.get('q') cat = Category() brand = Brand() pro = Product() a = pro.searchProducts(q, p, 4) b = brand.getBrands() c = cat.getCategories() total = pro.searchCount(q) n = ceil(total / 4) return render_template('home/search.html', arr=a, crr=c, brr=b, title=q, n=n)
def index(): brand = Brand() brr = brand.getBrands() return render_template('brand/index.html', brr=brr)
def edit(id): cat = Category() brand = Brand() pro = Product() return render_template('/product/edit.html', crr = cat.getCategories(), brr = brand.getBrands(), u = pro.getProductById(id))
def add(): cat = Category() br = Brand() return render_template('/product/add.html', brr = br.getBrands(), crr = cat.getCategories())