Coverage for model/ranking.py: 100%

11 statements  

« prev     ^ index     » next       coverage.py v7.3.2, created at 2024-11-05 04:22 +0000

1from flask import Blueprint, request 

2 

3from mongo import * 

4from .auth import * 

5from .utils import * 

6from mongo import engine 

7 

8__all__ = ['ranking_api'] 

9 

10ranking_api = Blueprint('ranking_api', __name__) 

11 

12 

13@ranking_api.route('/', methods=['GET']) 

14def get_ranking(): 

15 data = list({ 

16 "user": user.info, 

17 "ACProblem": len(user.AC_problem_ids), 

18 "ACSubmission": user.AC_submission, 

19 "Submission": user.submission 

20 } for user in engine.User.objects()) 

21 

22 return HTTPResponse('Success.', data=data)