本文整理汇总了Python中pyshop.models.Release.by_classifiers方法的典型用法代码示例。如果您正苦于以下问题:Python Release.by_classifiers方法的具体用法?Python Release.by_classifiers怎么用?Python Release.by_classifiers使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pyshop.models.Release
的用法示例。
在下文中一共展示了Release.by_classifiers方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_by_classifiers
# 需要导入模块: from pyshop.models import Release [as 别名]
# 或者: from pyshop.models.Release import by_classifiers [as 别名]
def test_by_classifiers(self):
from pyshop.models import Release
releases = Release.by_classifiers(self.session,
[u'Intended Audience :: Developers'])
self.assertIsInstance(releases, list)
releases = [(r.package.name, r.version) for r in releases]
self.assertEqual(releases, [(u'local_package1', u'0.1')])
示例2: browse
# 需要导入模块: from pyshop.models import Release [as 别名]
# 或者: from pyshop.models.Release import by_classifiers [as 别名]
def browse(self, classifiers):
"""
Retrieve a list of (name, version) pairs of all releases classified
with all of the given classifiers. 'classifiers' must be a list of
Trove classifier strings.
changelog(since)
Retrieve a list of four-tuples (name, version, timestamp, action)
since the given timestamp. All timestamps are UTC values.
The argument is a UTC integer seconds since the epoch.
"""
session = DBSession()
release = Release.by_classifiers(session, classifiers)
rv = [(r.package.name, r.version) for r in release]
return rv