Beispiel #1
0
 def userrender(self, template, **kw):
     categories = Category.getAllCategories()
     cart = self.session.get('cart')
     iconnumber = 0
     if cart:
         for position in cart:
             iconnumber = iconnumber + position[1]
     self.render(template, categories = categories, iconnumber = iconnumber, **kw)
Beispiel #2
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")
Beispiel #3
0
 def get(self):
     categories = Category.getAllCategories()
     self.adminrender("adminnewproduct.html", categories = categories)