当前位置: 首页>>代码示例>>Python>>正文


Python DB.query_all方法代码示例

本文整理汇总了Python中src.tools.db.DB.query_all方法的典型用法代码示例。如果您正苦于以下问题:Python DB.query_all方法的具体用法?Python DB.query_all怎么用?Python DB.query_all使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在src.tools.db.DB的用法示例。


在下文中一共展示了DB.query_all方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: query_answer_list_by_question_id

# 需要导入模块: from src.tools.db import DB [as 别名]
# 或者: from src.tools.db.DB import query_all [as 别名]
 def query_answer_list_by_question_id(self, question_id):
     raw_answer_list = DB.query_all(
         u'select * from Answer where question_id="{question_id}" {order_by} '.format(question_id=question_id, order_by=Config.answer_order_by))
     answer_list = []
     for raw_answer in raw_answer_list:
         answer_list.append(self.format_answer(raw_answer))
     return answer_list
开发者ID:EleVenPerfect,项目名称:OTHERS,代码行数:9,代码来源:task_result.py

示例2: query_question_list

# 需要导入模块: from src.tools.db import DB [as 别名]
# 或者: from src.tools.db.DB import query_all [as 别名]
 def query_question_list(self, question_id_list):
     raw_question_list = DB.query_all(
         u'select * from Question where question_id in ({question_id_list})'.format(question_id_list=','.join(question_id_list)))
     question_list = []
     for raw_question in raw_question_list:
         question_list.append(self.format_question(raw_question))
     return question_list
开发者ID:EleVenPerfect,项目名称:OTHERS,代码行数:9,代码来源:task_result.py

示例3: query_article_list_by_column_id

# 需要导入模块: from src.tools.db import DB [as 别名]
# 或者: from src.tools.db.DB import query_all [as 别名]
 def query_article_list_by_column_id(self, column_id):
     #   根据发表时间正序获取文章列表,方便浏览
     raw_article_list = DB.query_all(u'select * from Article where column_id="{column_id}"  {order_by}'.format(column_id=column_id, order_by=Config.article_order_by))
     article_list = []
     for raw_article in raw_article_list:
         article = self.format_article(raw_article)
         article_list.append(article)
     return article_list
开发者ID:EleVenPerfect,项目名称:OTHERS,代码行数:10,代码来源:task_result.py

示例4: query_answer_list_by_author_page_id

# 需要导入模块: from src.tools.db import DB [as 别名]
# 或者: from src.tools.db.DB import query_all [as 别名]
 def query_answer_list_by_author_page_id(self, author_page_id):
     # 需要先查出来对应的author_id
     author_info = DB.query_row(u'select author_id from Author where author_page_id="{author_page_id}"'.format(author_page_id=author_page_id))
     author_id = author_info[u'author_id']
     raw_answer_list = DB.query_all(u'select * from Answer where author_id="{author_id}"  {order_by} '.format(author_id=author_id, order_by=Config.answer_order_by))
     answer_list = []
     for raw_answer in raw_answer_list:
         answer_list.append(self.format_answer(raw_answer))
     return answer_list
开发者ID:EleVenPerfect,项目名称:OTHERS,代码行数:11,代码来源:task_result.py

示例5: query_answer_list

# 需要导入模块: from src.tools.db import DB [as 别名]
# 或者: from src.tools.db.DB import query_all [as 别名]
 def query_answer_list(self, answer_id_list):
     raw_answer_list = DB.query_all(u'select * from Answer where answer_id in ({answer_id_list}) {order_by} '.format(answer_id_list=','.join(answer_id_list), order_by=Config.topic_or_collection_answer_order_by))
     answer_list = []
     for raw_answer in raw_answer_list:
         answer_list.append(self.format_answer(raw_answer))
     return answer_list
开发者ID:EleVenPerfect,项目名称:OTHERS,代码行数:8,代码来源:task_result.py


注:本文中的src.tools.db.DB.query_all方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。