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