예제 #1
0
파일: user.py 프로젝트: abyx/codeduel
 def _get_all_users(self):
     all_snips = Snippet.all()
     return dict((str(s.submitter.user_id()), s.submitter) for s in all_snips if s.submitter is not None)
예제 #2
0
파일: user.py 프로젝트: abyx/codeduel
 def _get_snippets_for_id(self, user_id):
     all_snips = Snippet.all()
     return [s for s in all_snips if s.submitter is not None and s.submitter.user_id() == user_id]
예제 #3
0
파일: top.py 프로젝트: abyx/codeduel
 def _get_sorted_snippets(self):
     query = Snippet.all().order("-rank")
     return query.fetch(limit = LIMIT_TOP_RANKS)