本文整理汇总了Python中DBUtil.select_log_count方法的典型用法代码示例。如果您正苦于以下问题:Python DBUtil.select_log_count方法的具体用法?Python DBUtil.select_log_count怎么用?Python DBUtil.select_log_count使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DBUtil
的用法示例。
在下文中一共展示了DBUtil.select_log_count方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: range
# 需要导入模块: import DBUtil [as 别名]
# 或者: from DBUtil import select_log_count [as 别名]
#-*-coding:utf-8-*-
"""
Description
Created on 11/14/15
@author: Hui Li
"""
from random import randint
import DBUtil
if __name__=="__main__":
log_count = DBUtil.select_log_count()
# randon pick 45 logs and do injections
ids = []
for i in range(0, 45):
ids.append(randint(1, log_count + 1))
print ids
# all random ids
ids = [782646, 767402, 171206, 329690, 436102, 853455, 568442, 709924, 891034, 425445, 349647, 593099, 155354, 168514, 126931, 596548, 315300, 605358, 239982, 27978, 174194, 781837, 390737, 818783, 546082, 877560, 464808, 424398, 512913, 899854, 106033, 33012, 342636, 674911, 39162, 794296, 901763, 823964, 749323, 691157, 740987, 292924, 430652, 814821, 718571]
# actually used ids
# ids = [782646, 767402, 171206, 329690, 436102, 853455, 568442, 709924, 891034, 425445, 349647, 593099, 27978, 174194, 781837, 390737, 818783, 546082, 877560, 464808, 424398, 512913, 899854, 106033, 33012, 342636, 674911, 39162, 794296, 901763, 823964, 749323, 691157, 740987, 292924, 430652, 814821, 718571]
print ids[0]
log = DBUtil.select_one_log(ids[0])
log.s_sitename = "DRUPAL"