def GET(): contests = db.Read_Contestlist() users = list(db.Read_Userlist()) users.sort(key=lambda x: (x['total_ac'], -x['total_submit']), reverse=True) zishengs = db.Read_Zisheng() return render_template('home.html', contests=contests, users=users[:10], zishengs=zishengs)
def Run(): contestlist = db.Read_Contestlist() return render_template('contestlist.html', contestlist=contestlist)
def Contest_Players_Recalculate_All(): contests = db.Read_Contestlist() for contest in contests: contest_id = contest[0] Contest_Players_Recalculate(contest_id)
def Run(): contests = db.Read_Contestlist() users = list(db.Read_Userlist()) users.sort( key = lambda x: (x[9],-x[10]) , reverse=True ) return render_template('home.html',contests=contests,users=users[:10])