Skip to content
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
Cannot retrieve contributors at this time
class Review(db.Model):
id = db.Column(db.Integer, primary_key=True)
user_id = db.Column(db.Integer)
product_id = db.Column(db.Integer)
stars = db.Column(db.Integer)
review = db.Column(db.String(1024))
@app.route('/submit_review', methods=['POST'])
def submit_review():
user_id = request.form.get('user_id')
product_id = request.form.get('product_id')
review = request.form.get('review')
stars = request.form.get('stars')
# Server should use parameterized queries to prevent SQL injection attacks.
review = Review(user_id=user_id, product_id=product_id, stars=stars,review=review )
return render_template('products.html')