def index(self): user_model = User() category_model = Category() product_model = Product() users = user_model.get_total_users() categories = category_model.get_total_categories() products = product_model.get_total_products() last_products = product_model.get_last_products() return self.render('home_admin.html', report={ 'users': users[0], 'categories': categories[0], 'products': products[0] }, last_products=last_products)
def index(self): #return self.render('home_admin.html', data={'username':'******'}) user_model = User() category_model = Category() product_model = Product() users = user_model.get_total_users() categories = category_model.get_total_categories() products = product_model.get_total_products() last_products = product_model.get_last_products() return self.render('home_admin.html', report={ 'users': 0 if not users else users[0], 'categories': 0 if not categories else categories[0], 'products': 0 if not products else products[0] }, last_products=last_products)
def index(self): user_model = User() category_model = Category() product_model = Product() users = user_model.get_total_users() categories = category_model.get_total_categories() products = product_model.get_total_products() last_products = product_model.get_last_products() return self.render( "home_admin.html", report={ "users": 0 if not users else users[0], "categories": 0 if not categories else categories[0], "products": 0 if not products else products[0] }, last_products=last_products )