def product_customers()

in sql_implementation/__init__.py [0:0]


def product_customers(pk):
    customers = Customer.query.join(Order).join(OrderLine).join(Product).filter(Product.id == pk).order_by(
        Customer.id).all()
    return jsonify([{
        "id": cust.id,
        "full_name": cust.full_name,
        "company_name": cust.company_name,
        "email": cust.email,
        "address": cust.address,
        "postal_code": cust.postal_code,
        "city": cust.city,
        "country": cust.country,
    } for cust in customers])