modify a little

This commit is contained in:
wrmswindmill 2018-10-09 15:25:02 +08:00
parent 8fe3c117cf
commit 01e9e0ed60
3 changed files with 4 additions and 4 deletions

View File

@ -65,7 +65,7 @@ def update_rank_latest():
# 4.获取每个组的分数 # 4.获取每个组的分数
score = len(Annotation.objects.filter(user__in=users,file__in=competition_files)) score = len(Annotation.objects.filter(user__in=users,file__in=competition_files))
redis_db.zadd("gcb",score,team) redis_db.zadd("gcb",score,team)
with open('/user_team_data.json', 'w') as outfile: with open('user_team_data.json', 'w') as outfile:
json.dump(user_team_map, outfile) json.dump(user_team_map, outfile)
@ -73,7 +73,7 @@ def set_init_rank():
global user_team_map global user_team_map
# 1.获取当前的比赛项目id # 1.获取当前的比赛项目id
# competition_projects=Project.objects.filter(is_competition_project=1) # competition_projects=Project.objects.filter(is_competition_project=1)
with open('/user_team_data.json','r') as file: with open('user_team_data.json','r') as file:
user_team_map =json.load(file) user_team_map =json.load(file)
# for user_id in user_team_map: # for user_id in user_team_map:
# print(user_id,user_team_map[user_id]) # print(user_id,user_team_map[user_id])
@ -454,7 +454,7 @@ class AddAnnotationView(View):
elif str(request.user.id) not in user_team_map: elif str(request.user.id) not in user_team_map:
user_team_map[str(request.user.id)]=team_id user_team_map[str(request.user.id)]=team_id
# save to file # save to file
with open('/user_team_data.json', 'w') as outfile: with open('user_team_data.json', 'w') as outfile:
json.dump(user_team_map, outfile) json.dump(user_team_map, outfile)
redis_db.zincrby("gcc",team_id,1) redis_db.zincrby("gcc",team_id,1)
rank = int(redis_db.zrevrank("gcc",team_id))+1 rank = int(redis_db.zrevrank("gcc",team_id))+1

BIN
dump.rdb

Binary file not shown.

View File

@ -1 +1 @@
{"234": 280, "143": 281, "146": 281, "72": 285, "189": 285, "283": 288, "547": 285, "549": 285, "184": 288, "534": 288, "133": 290, "165": 290, "196": 290, "197": 290, "264": 290, "71": 292, "169": 292, "88": 293, "64": 295, "68": 295, "104": 295, "150": 295, "57": 298, "107": 298, "61": 337, "66": 302, "161": 305, "162": 305, "87": 319, "173": 310, "514": 310, "90": 317, "89": 323, "235": 327, "121": 328, "137": 373, "99": 331, "24": 337, "77": 341, "100": 357, "233": 357, "338": 363, "297": 366, "183": 373, "198": 374, "156": 379, "435": 382, "269": 390, "542": 392, "154": 400, "166": 400, "152": 402, "163": 404, "187": 413, "115": 414, "167": 414, "172": 414, "174": 414, "364": 418, "204": 422, "208": 430, "221": 436, "94": 439, "95": 439, "96": 439, "127": 440, "129": 440, "131": 440, "447": 442, "230": 444, "268": 450, "246": 451, "223": 452, "557": 460, "430": 462, "275": 464, "267": 468, "255": 469, "226": 470, "265": 477, "245": 480, "253": 480, "254": 480, "285": 480, "548": 480, "311": 486, "298": 488, "210": 490, "175": 496, "200": 496, "314": 499, "333": 503, "344": 510, "428": 510, "81": 516, "33": 562, "433": 518, "408": 535, "415": 539, "407": 545, "420": 546, "437": 557, "439": 557, "444": 560, "83": 562, "84": 562, "374": 569, "429": 570, "560": 570, "222": 572, "357": 573, "342": 576, "359": 576, "438": 576, "300": 579, "352": 581, "353": 581, "441": 583, "467": 584, "360": 588, "482": 593, "485": 594, "487": 595, "251": 600, "306": 600, "274": 602, "279": 602, "280": 602, "522": 610, "483": 611, "541": 614, "186": 616, "506": 619, "517": 631, "355": 633, "403": 633, "397": 634, "527": 637, "464": 640, "523": 640, "238": 643, "544": 643, "546": 643, "553": 648, "554": 648, "555": 648, "526": 650, "414": 651, "416": 651, "535": 651} {"234": 280, "143": 281, "146": 281, "630": 286, "283": 684, "184": 288, "534": 288, "570": 288, "133": 290, "165": 290, "196": 290, "197": 290, "264": 290, "71": 292, "169": 292, "88": 293, "64": 295, "68": 295, "104": 295, "150": 295, "57": 298, "107": 298, "61": 337, "66": 302, "658": 302, "161": 305, "162": 305, "87": 319, "173": 310, "514": 310, "652": 313, "703": 313, "90": 317, "89": 323, "689": 323, "235": 327, "582": 327, "626": 327, "121": 328, "137": 373, "683": 329, "99": 331, "738": 335, "24": 337, "77": 341, "584": 341, "100": 357, "233": 357, "338": 363, "297": 366, "183": 373, "198": 374, "156": 379, "435": 382, "269": 390, "542": 392, "576": 392, "711": 398, "727": 398, "154": 400, "166": 400, "152": 402, "163": 404, "750": 406, "187": 413, "115": 414, "167": 414, "172": 414, "174": 414, "364": 418, "204": 422, "208": 430, "221": 436, "650": 438, "696": 438, "94": 439, "95": 439, "96": 439, "567": 439, "127": 440, "129": 440, "131": 440, "447": 442, "717": 442, "230": 444, "268": 450, "610": 450, "246": 451, "223": 452, "557": 460, "430": 462, "275": 464, "267": 468, "255": 469, "226": 470, "265": 477, "741": 478, "245": 480, "253": 480, "254": 480, "285": 480, "548": 480, "311": 486, "298": 488, "210": 490, "578": 493, "175": 496, "200": 496, "314": 499, "333": 503, "706": 504, "705": 506, "710": 506, "344": 510, "428": 510, "81": 516, "33": 562, "433": 518, "408": 535, "638": 536, "415": 539, "407": 545, "420": 546, "437": 557, "439": 557, "444": 560, "83": 562, "84": 562, "580": 562, "374": 569, "429": 570, "560": 570, "222": 572, "357": 573, "342": 576, "359": 576, "438": 576, "300": 579, "352": 581, "353": 581, "751": 581, "586": 582, "441": 583, "634": 584, "360": 588, "482": 593, "485": 594, "487": 595, "251": 600, "306": 600, "274": 602, "279": 602, "280": 602, "522": 610, "483": 611, "541": 614, "186": 616, "506": 619, "662": 625, "631": 627, "517": 631, "355": 633, "403": 633, "397": 634, "527": 637, "464": 640, "523": 640, "561": 640, "635": 640, "669": 640, "238": 643, "544": 643, "546": 643, "553": 648, "554": 648, "555": 648, "526": 650, "414": 651, "416": 651, "535": 651, "605": 651, "568": 653, "240": 656, "573": 657, "742": 658, "467": 659, "589": 662, "368": 664, "591": 666, "136": 672, "601": 673, "602": 673, "737": 679, "616": 681, "619": 681, "622": 681, "645": 681, "231": 682, "649": 683, "72": 684, "549": 684, "562": 685, "657": 686, "671": 688, "600": 691, "701": 691, "361": 696, "693": 696, "707": 700, "347": 706, "647": 711, "708": 714, "730": 716, "735": 716, "521": 727, "744": 728, "431": 732, "376": 655, "748": 420, "451": 567, "287": 692, "747": 420, "341": 505, "538": 449, "758": 619, "564": 652, "624": 505, "682": 567, "719": 449, "566": 567, "694": 692, "565": 567, "237": 449, "78": 312, "787": 692, "390": 526, "574": 567, "678": 692, "241": 449, "214": 316}