Merge lp:~mvo/rnr-server/rnrclient-add-sorting-api into lp:~rnr-developers/rnr-server/rnrclient

Proposed by Michael Vogt
Status: Merged
Approved by: Łukasz Czyżykowski
Approved revision: 37
Merged at revision: 37
Proposed branch: lp:~mvo/rnr-server/rnrclient-add-sorting-api
Merge into: lp:~rnr-developers/rnr-server/rnrclient
Diff against target: 27 lines (+4/-3)
1 file modified
rnrclient.py (+4/-3)
To merge this branch: bzr merge lp:~mvo/rnr-server/rnrclient-add-sorting-api
Reviewer Review Type Date Requested Status
Ratings and Reviews Developers Pending
Review via email: mp+79277@code.launchpad.net

Commit message

Added sorting api to rnrclient get_reviews().

Description of the change

This adds the "sorting" API to the rnrclient. Thanks to Aaron who did the work on this.

To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'rnrclient.py'
2--- rnrclient.py 2011-05-30 10:47:36 +0000
3+++ rnrclient.py 2011-10-13 13:49:23 +0000
4@@ -102,9 +102,10 @@
5 @validate_pattern('packagename', r'[a-z0-9.+-]+')
6 @validate('appname', str, required=False)
7 @validate('page', int, required=False)
8+ @validate('sort', str, required=False)
9 @returns_list_of(ReviewDetails)
10 def get_reviews(self, packagename, language='any', origin='any',
11- distroseries='any', version='any', appname='', page=1):
12+ distroseries='any', version='any', appname='', page=1, sort='helpful'):
13 """Fetch ratings and reviews for a particular package name.
14
15 If any of the optional arguments are provided, fetch reviews for that
16@@ -112,9 +113,9 @@
17 """
18 if appname:
19 appname = quote_plus(';' + appname)
20- return self._get('reviews/filter/%s/%s/%s/%s/%s%s/page/%s/' % (
21+ return self._get('reviews/filter/%s/%s/%s/%s/%s%s/page/%s/%s/' % (
22 language, origin, distroseries, version, packagename,
23- appname, page),
24+ appname, page, sort),
25 scheme=PUBLIC_API_SCHEME)
26
27 @validate('review_id', int)

Subscribers

People subscribed via source and target branches

to all changes: