当前位置: 首页>>代码示例>>Python>>正文


Python Table.insert方法代码示例

本文整理汇总了Python中table.Table.insert方法的典型用法代码示例。如果您正苦于以下问题:Python Table.insert方法的具体用法?Python Table.insert怎么用?Python Table.insert使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在table.Table的用法示例。


在下文中一共展示了Table.insert方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: __call__

# 需要导入模块: from table import Table [as 别名]
# 或者: from table.Table import insert [as 别名]
 def __call__(self, category, player_id, dct):
     table_name = 'gc_cur_team_stats_{0}'.format(category)
     table = Table(table_name)
     table.insert(
         self.cursor,
         getattr(values, table_name)(
             self.gc_cur_team_id,
             player_id,
             dct))
开发者ID:jthomm,项目名称:landeta,代码行数:11,代码来源:landeta.py

示例2: GcGameTeamInserter

# 需要导入模块: from table import Table [as 别名]
# 或者: from table.Table import insert [as 别名]
class GcGameTeamInserter(object):

    def __init__(self, cursor, gc_game_id):
        self.cursor = cursor
        self.gc_game_id = gc_game_id
        self.table = Table('gc_game_team')

    def __call__(self, abbr, dct):
        self.table.insert(
            self.cursor,
            values.gc_game_team(self.gc_game_id, abbr, dct))
开发者ID:jthomm,项目名称:landeta,代码行数:13,代码来源:landeta.py

示例3: GcTeamInserter

# 需要导入模块: from table import Table [as 别名]
# 或者: from table.Table import insert [as 别名]
class GcTeamInserter(object):

    def __init__(self, cursor, gc_id):
        self.cursor = cursor
        self.gc_id = gc_id
        self.table = Table('gc_team')

    def __call__(self, dct):
        for ah in ('away', 'home',):
            self.table.insert(
                self.cursor,
                values.gc_team(self.gc_id, ah, dct[ah]))
开发者ID:jthomm,项目名称:landeta,代码行数:14,代码来源:landeta.py

示例4: GcCurTeamStatsTeamInserter

# 需要导入模块: from table import Table [as 别名]
# 或者: from table.Table import insert [as 别名]
class GcCurTeamStatsTeamInserter(object):

    def __init__(self, cursor, gc_cur_team_id):
        self.cursor = cursor
        self.gc_cur_team_id = gc_cur_team_id
        self.table = Table('gc_cur_team_stats_team')

    def __call__(self, dct):
        self.table.insert(
            self.cursor,
            values.gc_cur_team_stats_team(
                self.gc_cur_team_id,
                dct))
开发者ID:jthomm,项目名称:landeta,代码行数:15,代码来源:landeta.py

示例5: GcCurTeamScoreInserter

# 需要导入模块: from table import Table [as 别名]
# 或者: from table.Table import insert [as 别名]
class GcCurTeamScoreInserter(object):

    def __init__(self, cursor, gc_cur_team_id):
        self.cursor = cursor
        self.gc_cur_team_id = gc_cur_team_id
        self.table = Table('gc_cur_team_score')

    def __call__(self, qtr, points):
        self.table.insert(
            self.cursor,
            values.gc_cur_team_score(
                self.gc_cur_team_id,
                qtr,
                points))
开发者ID:jthomm,项目名称:landeta,代码行数:16,代码来源:landeta.py

示例6: GcCurScrsummaryPlayerInserter

# 需要导入模块: from table import Table [as 别名]
# 或者: from table.Table import insert [as 别名]
class GcCurScrsummaryPlayerInserter(object):

    def __init__(self, cursor, gc_cur_scrsummary_id):
        self.cursor = cursor
        self.gc_cur_scrsummary_id = gc_cur_scrsummary_id
        self.table = Table('gc_cur_scrsummary_player')

    def __call__(self, gc_player_name, gc_player_id):
        self.table.insert(
            self.cursor,
            values.gc_cur_scrsummary_player(
                self.gc_cur_scrsummary_id,
                gc_player_name,
                gc_player_id))
开发者ID:jthomm,项目名称:landeta,代码行数:16,代码来源:landeta.py

示例7: GcCurTeamPlayerInserter

# 需要导入模块: from table import Table [as 别名]
# 或者: from table.Table import insert [as 别名]
class GcCurTeamPlayerInserter(object):

    def __init__(self, cursor, gc_cur_team_id):
        self.cursor = cursor
        self.gc_cur_team_id = gc_cur_team_id
        self.table = Table('gc_cur_team_player')

    def __call__(self, gc_player_id, dct):
        self.table.insert(
            self.cursor,
            values.gc_cur_team_player(
                self.gc_cur_team_id,
                gc_player_id,
                dct))
开发者ID:jthomm,项目名称:landeta,代码行数:16,代码来源:landeta.py

示例8: GcCurDrivePlayEventInserter

# 需要导入模块: from table import Table [as 别名]
# 或者: from table.Table import insert [as 别名]
class GcCurDrivePlayEventInserter(object):

    def __init__(self, cursor, gc_cur_drive_play_id):
        self.cursor = cursor
        self.gc_cur_drive_play_id = gc_cur_drive_play_id
        self.table = Table('gc_cur_drive_play_event')

    def __call__(self, gc_player_id, dct):
        vals = values.gc_cur_drive_play_event(
            self.gc_cur_drive_play_id, gc_player_id, dct)
        self.table.insert(
            self.cursor,
            values.gc_cur_drive_play_event(
                self.gc_cur_drive_play_id,
                gc_player_id,
                dct))
开发者ID:jthomm,项目名称:landeta,代码行数:18,代码来源:landeta.py

示例9: GcCurInserter

# 需要导入模块: from table import Table [as 别名]
# 或者: from table.Table import insert [as 别名]
class GcCurInserter(object):

    def __init__(self, cursor, gc_id):
        self.cursor = cursor
        self.gc_id = gc_id
        self.table = Table('gc_cur')

    def __call__(self, dct):
        gc_cur_id = self.table.insert(
            self.cursor,
            values.gc_cur(self.gc_id, dct))
        # Insert drives
        drive_inserter = GcCurDriveInserter(self.cursor, gc_cur_id)
        for drive_num, drive_dct in dct['drives'].iteritems():
            # Most keys in `dct['drives']` will be a drive number and their 
            # values will be a drive dictionary.  One exception:  the key 
            # 'crntdrv', which has an integer value.  Skip this key/value pair.
            if drive_num != 'crntdrv':
                drive_inserter(drive_num, drive_dct)
        # Insert teams
        team_inserter = GcCurTeamInserter(self.cursor, gc_cur_id)
        for ah in ('away', 'home',):
            team_inserter(ah, dct[ah])
        # Insert score summary
        scrsummary_inserter = GcCurScrsummaryInserter(self.cursor, gc_cur_id)
        for gc_play_id, scrsummary_dct in dct['scrsummary'].iteritems():
            scrsummary_inserter(gc_play_id, scrsummary_dct)
开发者ID:jthomm,项目名称:landeta,代码行数:29,代码来源:landeta.py

示例10: GcGameInserter

# 需要导入模块: from table import Table [as 别名]
# 或者: from table.Table import insert [as 别名]
class GcGameInserter(object):

    def __init__(self, cursor, gc_id):
        self.cursor = cursor
        self.gc_id = gc_id
        self.table = Table('gc_game')

    def __call__(self, game_id, dct):
        gc_game_id = self.table.insert(
            self.cursor,
            values.gc_game(game_id, dct))
        game_team_inserter = GcGameTeamInserter(cursor, gc_game_id)
        for abbr, game_team_dct in dct['teams'].iteritems():
            game_team_inserter(abbr, game_team_dct)
开发者ID:jthomm,项目名称:landeta,代码行数:16,代码来源:landeta.py

示例11: GcCurDriveInserter

# 需要导入模块: from table import Table [as 别名]
# 或者: from table.Table import insert [as 别名]
class GcCurDriveInserter(object):

    def __init__(self, cursor, gc_cur_id):
        self.cursor = cursor
        self.gc_cur_id = gc_cur_id
        self.table = Table('gc_cur_drive')

    def __call__(self, drive_num, dct):
        gc_cur_drive_id = self.table.insert(
            self.cursor,
            values.gc_cur_drive(
                self.gc_cur_id,
                drive_num,
                dct))
        play_inserter = GcCurDrivePlayInserter(self.cursor, gc_cur_drive_id)
        for gc_play_id, play_dct in dct['plays'].iteritems():
            play_inserter(gc_play_id, play_dct)
开发者ID:jthomm,项目名称:landeta,代码行数:19,代码来源:landeta.py

示例12: GcInserter

# 需要导入模块: from table import Table [as 别名]
# 或者: from table.Table import insert [as 别名]
class GcInserter(object):

    def __init__(self, cursor, game_id):
        self.cursor = cursor
        self.game_id = game_id
        self.table = Table('gc')

    def __call__(self, dct):
        gc_id = self.table.insert(
            self.cursor,
            values.gc(self.game_id))
        gc_game_inserter = GcGameInserter(self.cursor, gc_id)
        #gc_game_inserter(self.game_id, dct['game'])
        gc_game_inserter(gc_id, dct['game'])
        gc_team_inserter = GcTeamInserter(self.cursor, gc_id)
        gc_team_inserter(dct['teams'])
        gc_cur_inserter = GcCurInserter(self.cursor, gc_id)
        gc_cur_inserter(dct['current'][self.game_id])
开发者ID:jthomm,项目名称:landeta,代码行数:20,代码来源:landeta.py

示例13: GcCurScrsummaryInserter

# 需要导入模块: from table import Table [as 别名]
# 或者: from table.Table import insert [as 别名]
class GcCurScrsummaryInserter(object):

    def __init__(self, cursor, gc_cur_id):
        self.cursor = cursor
        self.gc_cur_id = gc_cur_id
        self.table = Table('gc_cur_scrsummary')

    def __call__(self, gc_play_id, dct):
        gc_cur_scrsummary_id = self.table.insert(
            self.cursor,
            values.gc_cur_scrsummary(
                self.gc_cur_id,
                gc_play_id,
                dct))
        scrsummary_player_inserter = GcCurScrsummaryPlayerInserter(
            self.cursor, gc_cur_scrsummary_id)
        for gc_player_name, gc_player_id in dct['players'].iteritems():
            scrsummary_player_inserter(gc_player_name, gc_player_id)
开发者ID:jthomm,项目名称:landeta,代码行数:20,代码来源:landeta.py

示例14: GcCurDrivePlayInserter

# 需要导入模块: from table import Table [as 别名]
# 或者: from table.Table import insert [as 别名]
class GcCurDrivePlayInserter(object):

    def __init__(self, cursor, gc_cur_drive_id):
        self.cursor = cursor
        self.gc_cur_drive_id = gc_cur_drive_id
        self.table = Table('gc_cur_drive_play')

    def __call__(self, gc_play_id, dct):
        gc_cur_drive_play_id = self.table.insert(
            self.cursor,
            values.gc_cur_drive_play(
                self.gc_cur_drive_id,
                gc_play_id,
                dct))
        event_inserter = GcCurDrivePlayEventInserter(
            self.cursor,
            gc_cur_drive_play_id)
        for gc_player_id, event_dcts in dct['players'].iteritems():
            for event_dct in event_dcts:
                event_inserter(gc_player_id, event_dct)
开发者ID:jthomm,项目名称:landeta,代码行数:22,代码来源:landeta.py

示例15: GcCurTeamInserter

# 需要导入模块: from table import Table [as 别名]
# 或者: from table.Table import insert [as 别名]
class GcCurTeamInserter(object):

    def __init__(self, cursor, gc_cur_id):
        self.cursor = cursor
        self.gc_cur_id = gc_cur_id
        self.table = Table('gc_cur_team')

    def __call__(self, ah, dct):
        gc_cur_team_id = self.table.insert(
            self.cursor,
            values.gc_cur_team(
                self.gc_cur_id,
                ah,
                dct))
        # Insert score
        score_inserter = GcCurTeamScoreInserter(
            self.cursor, gc_cur_team_id)
        for qtr, points in dct['score'].iteritems():
            score_inserter(qtr, points)
        # Insert team players
        team_player_inserter = GcCurTeamPlayerInserter(
            self.cursor, gc_cur_team_id)
        for gc_player_id, gc_player_dct in dct['players'].iteritems():
            team_player_inserter(gc_player_id, gc_player_dct)
        # Insert team stats
        stats_team_inserter = GcCurTeamStatsTeamInserter(
            self.cursor, gc_cur_team_id)
        stats_team_inserter(dct['stats']['team'])
        # Insert individual stats
        stats_individual_inserter = GcCurTeamStatsIndividualInserter(
            self.cursor, gc_cur_team_id)
        for category in ('kickret', 'puntret', 'defense', 'fumbles', \
                         'kicking', 'punting', 'passing', 'receiving', \
                         'rushing',):
            if category not in dct['stats']:
                # Some categories aren't in every team dict in every game?
                continue
            for player_id, category_dct in dct['stats'][category].iteritems():
                stats_individual_inserter(
                    category, player_id, category_dct)
开发者ID:jthomm,项目名称:landeta,代码行数:42,代码来源:landeta.py


注:本文中的table.Table.insert方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。