本文整理匯總了Python中models.DAO.DAO.update方法的典型用法代碼示例。如果您正苦於以下問題:Python DAO.update方法的具體用法?Python DAO.update怎麽用?Python DAO.update使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類models.DAO.DAO
的用法示例。
在下文中一共展示了DAO.update方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: update_follow_count
# 需要導入模塊: from models.DAO import DAO [as 別名]
# 或者: from models.DAO.DAO import update [as 別名]
def update_follow_count(tale_id, value):
DAO.update(
'''
UPDATE anaddventure.tale
SET tale_follow_count = tale_follow_count + (%s)
WHERE tale_id = (%s)
''',
(value, tale_id)
)
示例2: update_contribution_request_count
# 需要導入模塊: from models.DAO import DAO [as 別名]
# 或者: from models.DAO.DAO import update [as 別名]
def update_contribution_request_count(tale_id, value):
DAO.update(
'''
UPDATE anaddventure.tale
SET tale_contribution_request_count = tale_contribution_request_count + (%s)
WHERE tale_id = (%s)
''',
(value, tale_id)
)
示例3: update_all
# 需要導入模塊: from models.DAO import DAO [as 別名]
# 或者: from models.DAO.DAO import update [as 別名]
def update_all(tale_id, title, description, category, license_id):
DAO.update(
'''
UPDATE anaddventure.tale
SET tale_title = (%s),
tale_description = (%s),
tale_category = (%s),
tale_license = (%s)
WHERE tale_id = (%s)
''',
(title, description, category, license_id, tale_id)
)
示例4: update_title_and_content
# 需要導入模塊: from models.DAO import DAO [as 別名]
# 或者: from models.DAO.DAO import update [as 別名]
def update_title_and_content(contribution_request_id, title, content):
return DAO.update(
'''
UPDATE anaddventure.contribution_request
SET contribution_request_title = (%s),
contribution_request_content = (%s)
WHERE contribution_request_id = (%s)
''',
(title, content, contribution_request_id)
)
示例5: update_was_accepted
# 需要導入模塊: from models.DAO import DAO [as 別名]
# 或者: from models.DAO.DAO import update [as 別名]
def update_was_accepted(contribution_request_id, was_accepted):
return DAO.update(
'''
UPDATE anaddventure.contribution_request
SET contribution_request_was_accepted = (%s),
contribution_request_was_closed = True
WHERE contribution_request_id = (%s)
''',
(was_accepted, contribution_request_id)
)
示例6: update_download_count
# 需要導入模塊: from models.DAO import DAO [as 別名]
# 或者: from models.DAO.DAO import update [as 別名]
def update_download_count(chapter_id):
return DAO.update(
"UPDATE anaddventure.chapter SET chapter_download_count = chapter_download_count + 1 WHERE chapter_id = (%s)",
(chapter_id, )
)
示例7: update_title_and_content
# 需要導入模塊: from models.DAO import DAO [as 別名]
# 或者: from models.DAO.DAO import update [as 別名]
def update_title_and_content(chapter_id, title, content):
return DAO.update(
"UPDATE anaddventure.chapter SET chapter_title = (%s), chapter_content = (%s) WHERE chapter_id = (%s)",
(title, content, chapter_id)
)