def get(self, product_id_string): if product_id_string.isdigit(): product_id = int(product_id_string) product = Product.getProductById(product_id) subproducts = Product.getSubProducts(product_id) self.userrender("userproduct.html", product = product, subproducts = subproducts) else: self.redirect('/')
def get(self, product_id_string): if product_id_string.isdigit() and self.checkAdminCookie(): product_id = int(product_id_string) product = Product.getProductById(product_id) subproducts = Product.getSubProducts(product_id) self.adminrender("admineditsubproduct.html", product = product, subproducts = subproducts) else: self.redirect("/admin/index")
def get(self,product_id_string): if product_id_string.isdigit(): product_id = int(product_id_string) product = Product.getProductById(product_id) category = Category.getCategoryById(product.category.id()) categories = Category.getAllCategories() self.adminrender("admineditproduct.html", product = product, category = category, categories = categories) else: self.redirect("/admin/index")