Esempio n. 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 []
Esempio n. 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 []
Esempio n. 3
0
 def get_contest_id(self):
     return api.ballot_list_contests()['result'][0]
Esempio n. 4
0
 def get_contest_id(self):
     return api.ballot_list_contests()['result'][0]