コード例 #1
0
 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)
コード例 #2
0
    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)
コード例 #3
0
ファイル: Views.py プロジェクト: linnikmaciel/livro_flask
    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
        )