本文整理汇总了Python中MySQLdb.cursors.Cursor方法的典型用法代码示例。如果您正苦于以下问题:Python cursors.Cursor方法的具体用法?Python cursors.Cursor怎么用?Python cursors.Cursor使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MySQLdb.cursors
的用法示例。
在下文中一共展示了cursors.Cursor方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: cursor
# 需要导入模块: from MySQLdb import cursors [as 别名]
# 或者: from MySQLdb.cursors import Cursor [as 别名]
def cursor(self, cursorclass=None):
"""
Create a cursor on which queries may be performed. The
optional cursorclass parameter is used to create the
Cursor. By default, self.cursorclass=cursors.Cursor is
used.
"""
return (cursorclass or self.cursorclass)(self)
示例2: cursor
# 需要导入模块: from MySQLdb import cursors [as 别名]
# 或者: from MySQLdb.cursors import Cursor [as 别名]
def cursor(self, cursorclass=None):
"""
Create a cursor on which queries may be performed. The
optional cursorclass parameter is used to create the
Cursor. By default, self.cursorclass=cursors.Cursor is
used.
"""
return (cursorclass or self.cursorclass)(self)
示例3: mock_source_cursor
# 需要导入模块: from MySQLdb import cursors [as 别名]
# 或者: from MySQLdb.cursors import Cursor [as 别名]
def mock_source_cursor():
return mock.Mock(spec=Cursor)
示例4: mock_tracker_cursor
# 需要导入模块: from MySQLdb import cursors [as 别名]
# 或者: from MySQLdb.cursors import Cursor [as 别名]
def mock_tracker_cursor():
return mock.Mock(spec=Cursor)
示例5: mock_state_cursor
# 需要导入模块: from MySQLdb import cursors [as 别名]
# 或者: from MySQLdb.cursors import Cursor [as 别名]
def mock_state_cursor():
return mock.Mock(spec=Cursor)
示例6: mock_tracker_cursor
# 需要导入模块: from MySQLdb import cursors [as 别名]
# 或者: from MySQLdb.cursors import Cursor [as 别名]
def mock_tracker_cursor(self, test_table, show_create_query):
m = mock.Mock(spec=Cursor)
m.fetchone.return_value = [test_table, show_create_query]
return m