Skip to content

Commit

Permalink
Add join function
Browse files Browse the repository at this point in the history
  • Loading branch information
pamelafox committed Jun 18, 2024
1 parent abcb347 commit 376e0f2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/backend/surveys/routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def surveys_create_handler():
@bp.route("/surveys/<int:survey_id>", methods=["GET"])
def survey_page(survey_id):
survey = db.get_or_404(Survey, survey_id)
answers = db.session.execute(select(Survey).where(Answer.survey == survey_id)).scalars().all()
answers = db.session.execute(select(Survey).join(Answer).where(Answer.survey == survey_id)).scalars().all()
return render_template(
"survey_details.html",
survey=survey,
Expand Down

0 comments on commit 376e0f2

Please sign in to comment.