本文整理汇总了Python中DB.fetchall_cacheable方法的典型用法代码示例。如果您正苦于以下问题:Python DB.fetchall_cacheable方法的具体用法?Python DB.fetchall_cacheable怎么用?Python DB.fetchall_cacheable使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DB
的用法示例。
在下文中一共展示了DB.fetchall_cacheable方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: _refresh
# 需要导入模块: import DB [as 别名]
# 或者: from DB import fetchall_cacheable [as 别名]
def _refresh (self):
sql = self._get_sql()
self.sql_result = DB.fetchall_cacheable (sql)
return True
示例2: get_org_id
# 需要导入模块: import DB [as 别名]
# 或者: from DB import fetchall_cacheable [as 别名]
def get_org_id(mail = conf.USER):
username = mail.split('@')[0]
SQL = "select id from \"OrgChart2S.User\" u where u.Uid = '%s'" %(username)
return DB.fetchall_cacheable(SQL)[0]['id']
示例3: get_manager
# 需要导入模块: import DB [as 别名]
# 或者: from DB import fetchall_cacheable [as 别名]
def get_manager(mail = conf.USER):
username = mail.split('@')[0]
SQL = "select uid,realname from \"OrgChart2S.User\" u where u.id = ( select Manager from \"OrgChart2S.User\" u where u.Uid = '%s' )" %(username)
return DB.fetchall_cacheable(SQL)
示例4: get_direct_reports
# 需要导入模块: import DB [as 别名]
# 或者: from DB import fetchall_cacheable [as 别名]
def get_direct_reports(mail = conf.USER):
manager_id = get_org_id()
SQL = "select uid,realname from \"OrgChart2S.User\" u where u.Manager = '%s'" %(manager_id)
return DB.fetchall_cacheable(SQL)
示例5: get_user_id
# 需要导入模块: import DB [as 别名]
# 或者: from DB import fetchall_cacheable [as 别名]
def get_user_id(username = conf.USER):
SQL = "select userid from BugzillaS.profiles profiles where profiles.login_name = '%s'" %(username)
return DB.fetchall_cacheable(SQL)[0]['userid']
示例6: get_product_id
# 需要导入模块: import DB [as 别名]
# 或者: from DB import fetchall_cacheable [as 别名]
def get_product_id(product = conf.TASKS_PRODUCT):
SQL = "select id from BugzillaS.products products where products.name = '%s'" %(product)
return DB.fetchall_cacheable(SQL)[0]['id']