本文整理汇总了Python中models.package.Package.getallPackages方法的典型用法代码示例。如果您正苦于以下问题:Python Package.getallPackages方法的具体用法?Python Package.getallPackages怎么用?Python Package.getallPackages使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类models.package.Package
的用法示例。
在下文中一共展示了Package.getallPackages方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: post
# 需要导入模块: from models.package import Package [as 别名]
# 或者: from models.package.Package import getallPackages [as 别名]
def post(self):
package_name = self.get_argument("package_name", None)
status = self.get_argument("status", None)
page = self.get_argument('page', 1)
page = page if page >= 1 else 1
count = self.get_argument('count', 10)
count = count if count >= 1 else 10
template_values = {}
if package_name is not None:
if status is not None and status != '':
packages = Package.getPackageByCondition(package_name, int(status))
template_values['status'] = int(status)
else:
print package_name
packages = Package.getPackageByName(package_name)
print packages
template_values['status'] = ''
else:
if status is not None and status != '':
packages = Package.getPackageByStatus(int(status))
template_values['status'] = int(status)
else:
packages = Package.getallPackages()
template_values['status'] = ''
#create a Paginator object
paginator = Paginator(packages, page, count, len(packages))
template_values['_id'] = package_name
template_values['paginator'] = paginator
self.render_template('/site/searchPackage.html', **template_values)