Exemplo n.º 1
0
def get_user(userid):
    user = db.session.query(User).filter(User.id==userid).one()
    products = user.products
    other_products = [p.id for p in db.session.query(Product).all() if user not in p.users ]
    return render_template('user.html', 
                           user=(user.id, user.active, user.creation_date), 
                           products=format_product_info(products, user.id),
                           other_products=other_products)
Exemplo n.º 2
0
def get_user(userid):
    user = db.session.query(User).filter(User.id == userid).one()
    products = user.products
    other_products = [
        p.id for p in db.session.query(Product).all() if user not in p.users
    ]
    return render_template('user.html',
                           user=(user.id, user.active, user.creation_date),
                           products=format_product_info(products, user.id),
                           other_products=other_products)
Exemplo n.º 3
0
def get_products():
    products = db.session.query(Product).all()
    return render_template('products.html', products=format_product_info(products))
Exemplo n.º 4
0
def get_products():
    products = db.session.query(Product).all()
    return render_template('products.html',
                           products=format_product_info(products))