Exemplo n.º 1
0
 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('/')
Exemplo n.º 2
0
 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")
Exemplo n.º 3
0
 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")