示例#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)