本文整理匯總了Python中Session.Session.kind方法的典型用法代碼示例。如果您正苦於以下問題:Python Session.kind方法的具體用法?Python Session.kind怎麽用?Python Session.kind使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Session.Session
的用法示例。
在下文中一共展示了Session.kind方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: find
# 需要導入模塊: from Session import Session [as 別名]
# 或者: from Session.Session import kind [as 別名]
def find(self, id):
self.cursor.execute("""SELECT * FROM """+self.tablename+""" WHERE id = %s""", (id,))
rs = self.cursor.fetchall()
session = Session()
if not rs:
return None
for row in rs:
session.id = row[0]
session.startDate = row[1]
session.lastUpdate = row[2]
session.downloaded = row[3]
session.uploaded = row[4]
session.source.id = row[5]
session.file.id = row[6]
session.address.id = row[7]
session.kind = row[8]
return session
示例2: findBySourceFileAddress
# 需要導入模塊: from Session import Session [as 別名]
# 或者: from Session.Session import kind [as 別名]
def findBySourceFileAddress(self, sourceId, fileId, addressId):
query = "SELECT * FROM %s WHERE source_id = %s and file_id = %s and address_id = %s " % (self.tablename, sourceId, fileId, addressId)
logging.debug(query)
self.cursor.execute(query)
rs = self.cursor.fetchall()
if not rs:
return None
session = Session()
for row in rs:
session.id = row[0]
session.startDate = row[1]
session.lastUpdate = row[2]
session.downloaded = row[3]
session.uploaded = row[4]
session.source.id = row[5]
session.file.id = row[6]
session.address.id = row[7]
session.kind = row[8]
return session