本文整理匯總了Python中Session.Session.lastUpdate方法的典型用法代碼示例。如果您正苦於以下問題:Python Session.lastUpdate方法的具體用法?Python Session.lastUpdate怎麽用?Python Session.lastUpdate使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Session.Session
的用法示例。
在下文中一共展示了Session.lastUpdate方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: testInsert
# 需要導入模塊: from Session import Session [as 別名]
# 或者: from Session.Session import lastUpdate [as 別名]
def testInsert(self):
sdao = SessionDAO()
session = Session()
session.startDate = '2009-10-10'
session.lastUpdate = '2009-10-10'
session.source.id = self.sourceId
session.file.id = self.fileId
session.address.id = self.addressId
sid = sdao.insert(session)
assert sid != -1, 'error inserting session'
示例2: find
# 需要導入模塊: from Session import Session [as 別名]
# 或者: from Session.Session import lastUpdate [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
示例3: findBySourceFileAddress
# 需要導入模塊: from Session import Session [as 別名]
# 或者: from Session.Session import lastUpdate [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