Ejemplo n.º 1
0
    def check_group_integrity(self):
        '''

        2015-4-17: can't check this from set_players,
        because sometimes we are intentionally in an inconsistent state
        e.g., if group_by_arrival_time is true, and some players have not
        been assigned to groups yet
        '''
        players = get_players(self, order_by='id', refresh_from_db=True)
        groups = [get_players(g, 'id', True) for g in get_groups(self, True)]
        players_from_groups = flatten(groups)

        assert set(players) == set(players_from_groups)
Ejemplo n.º 2
0
    def check_group_integrity(self):
        '''

        2015-4-17: can't check this from set_players,
        because sometimes we are intentionally in an inconsistent state
        e.g., if group_by_arrival_time is true, and some players have not
        been assigned to groups yet
        '''
        players = get_players(self, order_by='id', refresh_from_db=True)
        groups = [get_players(g, 'id', True) for g in get_groups(self, True)]
        players_from_groups = flatten(groups)

        assert set(players) == set(players_from_groups)
Ejemplo n.º 3
0
 def _get_players(self, refresh_from_db=False):
     return get_players(self,
                        order_by='pk',
                        refresh_from_db=refresh_from_db)
Ejemplo n.º 4
0
 def _get_players(self, refresh_from_db=False):
     return get_players(self,
                        order_by='id_in_group',
                        refresh_from_db=refresh_from_db)
Ejemplo n.º 5
0
 def _get_players(self, refresh_from_db=False):
     return get_players(
         self, order_by='pk',
         refresh_from_db=refresh_from_db
     )
Ejemplo n.º 6
0
 def _get_players(self, refresh_from_db=False):
     return get_players(
         self, order_by='id_in_group',
         refresh_from_db=refresh_from_db
     )