コード例 #1
0
ファイル: demo_repository.py プロジェクト: driver4567/vote
    def _api_get_all_contests(cls):
        """returns a list of contest model objects

        the reason we are loading them in a loop instead of the batch method is because
        the batch method does not return id's hopefully this is something we can
        fix in the future

        """
        contest_ids = api.ballot_list_contests(limit=10000).get('result')
        if contest_ids:
            return [cls._api_get_contest_by_id(c) for c in contest_ids]
        else:
            return []
コード例 #2
0
ファイル: demo_repository.py プロジェクト: zukobronja/vote
    def _api_get_all_contests(cls):
        """returns a list of contest model objects

        the reason we are loading them in a loop instead of the batch method is because
        the batch method does not return id's hopefully this is something we can
        fix in the future

        """
        contest_ids = api.ballot_list_contests(limit=10000).get('result')
        if contest_ids:
            return [cls._api_get_contest_by_id(c) for c in contest_ids]
        else:
            return []
コード例 #3
0
 def get_contest_id(self):
     return api.ballot_list_contests()['result'][0]
コード例 #4
0
ファイル: test_api.py プロジェクト: driver4567/vote
 def get_contest_id(self):
     return api.ballot_list_contests()['result'][0]