def json(self): c.product_categories = ProductCategory.find_all() result = [] for category in c.product_categories: for product in category.products: product_dict = { 'id': product.id, 'category': category.name, 'category_order': category.display_order, 'product_order': product.display_order, 'cost': product.cost, 'description': product.description } result.append(product_dict) return {'r': result}
def json(self): c.product_categories = ProductCategory.find_all() result = [] for category in c.product_categories: for product in category.products: product_dict = { 'id': product.id, 'category': category.name, 'category_order': category.display_order, 'product_order': product.display_order, 'cost': product.cost, 'description': product.description } result.append(product_dict) return { 'r': result }
def index(self): c.can_edit = True c.product_category_collection = ProductCategory.find_all() return render('/product_category/list.mako')
def stats(self, id): c.can_edit = True c.product_category = ProductCategory.find_by_id(id) c.product_categories = ProductCategory.find_all() return render('/product_category/stats.mako')
def __before__(self, **kwargs): c.product_categories = ProductCategory.find_all() c.ceilings = Ceiling.find_all()
def __before__(self, **kwargs): c.product_categories = ProductCategory.find_all()
def __before__(self, **kwargs): c.product_categories = ProductCategory.find_all() c.fulfilment_types = FulfilmentType.find_all() c.ceilings = Ceiling.find_all()