flask_sqlalchemy_rest
flask_sqlalchemy_rest copied to clipboard
Get All Products returns "AttributeError: 'list' object has no attribute 'data'"
The correct one is:
Get All Products
@app.route('/product', methods=['GET']) def get_products(): all_products = Product.query.all() result = products_schema.dump(all_products) return jsonify(result)
Wrong syntax: return jsonify(result.data)
Thank you for the update. this was helpful.