Skip to content

Instantly share code, notes, and snippets.

@Sytten
Created May 19, 2020 01:23
Show Gist options
  • Save Sytten/a67c00efc4e486a69263e9f97e40dd30 to your computer and use it in GitHub Desktop.
Save Sytten/a67c00efc4e486a69263e9f97e40dd30 to your computer and use it in GitHub Desktop.
failing-revenge-grades-api
class GradeApi(Resource):
@https
def patch(self, student_id, course_id, grade_score):
grade = Grade.query.filter(Grade.student_id == student_id,
Grade.course_id == course_id).first()
if grade:
grade.grade_score = grade_score
db.session.commit()
return jsonify({'status':'ok'})
return jsonify({'status':'err'})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment