Пример #1
0
def products():
    if request.method == 'GET' or request.method == 'POST':

        if session["account_type"] == "seller":
            result = seller_products(session["user_id"])
        else:
            result = buyer_products()
        return render_template("products.html",
                               result=result[0],
                               isproducts=result[1])
Пример #2
0
def product_page():
	if session["accounttype"] == "seller":
		result = seller_products(session["user_id"])
	else:
		result = buyer_products()
	for value in result:
		seller_id = value.get("seller_id")
		seller_object = search_user_by_user_id(seller_id)
		seller_username = seller_object["username"]
		value["seller_username"] = seller_username
	return render_template('products.html', result=result)