예제 #1
0
    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
    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]