Beispiel #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)
Beispiel #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)
Beispiel #3
0
def get_products():
    products = db.session.query(Product).all()
    return render_template('products.html', products=format_product_info(products))
Beispiel #4
0
def get_products():
    products = db.session.query(Product).all()
    return render_template('products.html',
                           products=format_product_info(products))