本文整理汇总了Python中holmes.models.Page.get_next_job_list方法的典型用法代码示例。如果您正苦于以下问题:Python Page.get_next_job_list方法的具体用法?Python Page.get_next_job_list怎么用?Python Page.get_next_job_list使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类holmes.models.Page
的用法示例。
在下文中一共展示了Page.get_next_job_list方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: get
# 需要导入模块: from holmes.models import Page [as 别名]
# 或者: from holmes.models.Page import get_next_job_list [as 别名]
def get(self):
current_page = int(self.get_argument('current_page', 1))
page_size = int(self.get_argument('page_size', 10))
get_next_job_list = Page.get_next_job_list(
self.db,
self.application.config.REVIEW_EXPIRATION_IN_SECONDS,
current_page=current_page,
page_size=page_size
)
#review_count = self.girl.get('next_jobs_count')
review_count = 0
result = {'reviewCount': review_count}
pages = []
for item in get_next_job_list:
pages.append({
'uuid': item.uuid,
'url': item.url,
})
result['pages'] = pages
self.write_json(result)
示例2: test_get_next_job_list
# 需要导入模块: from holmes.models import Page [as 别名]
# 或者: from holmes.models.Page import get_next_job_list [as 别名]
def test_get_next_job_list(self):
page = PageFactory.create()
PageFactory.create()
next_job_list = Page.get_next_job_list(self.db, expiration=100)
expect(next_job_list).to_length(2)
pages = [{'url': x.url, 'uuid': str(x.uuid)} for x in next_job_list]
expect(pages).to_include({
'url': page.url,
'uuid': str(page.uuid)
})
示例3: get
# 需要导入模块: from holmes.models import Page [as 别名]
# 或者: from holmes.models.Page import get_next_job_list [as 别名]
def get(self):
current_page = int(self.get_argument("current_page", 1))
page_size = int(self.get_argument("page_size", 10))
get_next_job_list = Page.get_next_job_list(
self.db,
self.application.config.REVIEW_EXPIRATION_IN_SECONDS,
current_page=current_page,
page_size=page_size,
)
review_count = self.girl.get("next_jobs_count")
result = {"reviewCount": review_count}
pages = []
for item in get_next_job_list:
pages.append({"uuid": item.uuid, "url": item.url})
result["pages"] = pages
self.write_json(result)