def __before__(self, **kwargs): category = ProductCategory.find_by_name('Accommodation') if category and not (len(category.products) == 0 or (len(category.products) == 1 and category.products[0].cost == 0)): allowed_categories.append('Accommodation') c.product_categories = ProductCategory.find_all() self._generate_product_schema()
def __before__(self, **kwargs): category = ProductCategory.find_by_name('Accommodation') if not (len(category.products) == 0 or (len(category.products) == 1 and category.products[0].cost == 0)): allowed_categories.append('Accommodation') c.product_categories = ProductCategory.find_all() self._generate_product_schema()
def new(self): try: c.invoice_person = request.GET['person_id'] except: c.invoice_person = '' c.due_date = datetime.date.today().strftime("%d/%y/%Y") c.product_categories = ProductCategory.find_all() c.item_count = 0 return render("/invoice/new.mako")
def new(self): try: c.invoice_person = request.GET['person_id'] except: c.invoice_person = '' c.due_date = datetime.date.today().strftime("%d/%y/%Y") c.product_categories = ProductCategory.find_all() c.item_count = 0; return render("/invoice/new.mako")