I did outerjoin of two tables. And I got the correct result. But I don't know how to access the Columns in the result. Below is my code.
result = db.session.query(Purchase, Product.pr_id).outerjoin(Product, Purchase.id == Product.pr_id).filter(Purchase.user_id==current_user.id, Product.status==pr_status).order_by(desc(Purchase.cost)).all()
'result[0].Purchase.cost' gives me cost of the first purchase. But 'result[0].Product.status' giving AttributeError: Could not locate column in row for column 'Product'. Why this happen ? How can I access the 'status' column