Skip to content
Snippets Groups Projects
Commit c2d250fa authored by Jiří Setnička's avatar Jiří Setnička
Browse files

Výpis dělených kol v detailu účastníka

parent 57dbb834
Branches
No related tags found
1 merge request!48Dělená kola napotřetí
This commit is part of merge request !36. Comments created here will be created in the context of that merge request.
...@@ -301,12 +301,21 @@ def org_user(id: int): ...@@ -301,12 +301,21 @@ def org_user(id: int):
rr = g.gatekeeper.rights_generic() rr = g.gatekeeper.rights_generic()
participants = sess.query(db.Participant).filter_by(user_id=user.user_id) participants = sess.query(db.Participant).filter_by(user_id=user.user_id)
rounds = sess.query(db.Participation).filter_by(user_id=user.user_id) participations = (
sess.query(db.Participation, db.Contest, db.Round)
.select_from(db.Participation)
.join(db.Contest, db.Contest.master_contest_id == db.Participation.contest_id)
.join(db.Round)
.filter(db.Participation.user == user)
.options(joinedload(db.Contest.place))
.order_by(db.Round.year.desc(), db.Round.category, db.Round.seq, db.Round.part)
.all()
)
return render_template( return render_template(
'org_user.html', user=user, can_edit=rr.can_edit_user(user), 'org_user.html', user=user, can_edit=rr.can_edit_user(user),
can_incarnate=g.user.is_admin, can_incarnate=g.user.is_admin,
participants=participants, rounds=rounds participants=participants, participations=participations,
) )
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment