stats/player_general_traditional_total.py
def generate_rows(self, season_id):
        """
        Build GET REST request to the NBA for a season.
        Also populate this table.
        We cannot rely on the base table's generic method, due to the `season_id` field.
        """
        params = self.build_params(season_id)

        # Encode without safe '+', apparently the NBA likes unsafe url params.
        params_str = urllib.parse.urlencode(params, safe=':+')

        # json response
        response = requests.get(url=self.url, headers=headers, params=params_str).json()

        result_sets = response['resultSets'][0]
        rowset = result_sets['rowSet']

        column_names = column_names_from_table(self.settings.db, self.table._meta.table_name)

        column_mapping = get_rowset_mapping(result_sets, column_names)

        for row in rowset:
            new_row = {column_name: row[row_index] for column_name, row_index in column_mapping.items()}
            new_row['season_id'] = season_id_to_int(season_id)
            self.rows.append(new_row)

        super().populate()

        Build GET REST request to the NBA for a season.
        Also populate this table.
        We cannot rely on the base table's generic method, due to the `season_id` field.
        
Build GET REST request to the NBA for a season.
Also populate this table.
We cannot rely on the base table's generic method, due to the `season_id` field.
Build GET REST request to the NBA for a season . Also populate this table . We cannot rely on the base table ' s generic method due to the ` season_id ` field .
def generate_rows(self, season_id):
        params = self.build_params(season_id)
        params_str = urllib.parse.urlencode(params, safe=':+')
        response = requests.get(url=self.url, headers=headers, params=params_str).json()
        result_sets = response['resultSets'][0]
        rowset = result_sets['rowSet']
        column_names = column_names_from_table(self.settings.db, self.table._meta.table_name)
        column_mapping = get_rowset_mapping(result_sets, column_names)
        for row in rowset:
            new_row = {column_name: row[row_index] for column_name, row_index in column_mapping.items()}
            new_row['season_id'] = season_id_to_int(season_id)
            self.rows.append(new_row)
        super().populate()
def generate_rows ( self , season_id ) : params = self . build_params ( season_id ) params_str = urllib . parse . urlencode ( params , safe = ':+' ) response = requests . get ( url = self . url , headers = headers , params = params_str ) . json ( ) result_sets = response [ 'resultSets' ] [ 0 ] rowset = result_sets [ 'rowSet' ] column_names = column_names_from_table ( self . settings . db , self . table . _meta . table_name ) column_mapping = get_rowset_mapping ( result_sets , column_names ) for row in rowset : new_row = { column_name : row [ row_index ] for column_name , row_index in column_mapping . items ( ) } new_row [ 'season_id' ] = season_id_to_int ( season_id ) self . rows . append ( new_row ) super ( ) . populate ( )
Build GET REST request to the NBA for a season.
Build GET REST request to the NBA for a season .
"""
        Build GET REST request to the NBA for a season.
        Also populate this table.
        We cannot rely on the base table's generic method, due to the `season_id` field.
        """ # Encode without safe '+', apparently the NBA likes unsafe url params. # json response
self
season_id