Merge lp:~wgrant/launchpad/bug-690356 into lp:launchpad

Proposed by William Grant
Status: Merged
Approved by: Robert Collins
Approved revision: no longer in the source branch.
Merged at revision: 12536
Proposed branch: lp:~wgrant/launchpad/bug-690356
Merge into: lp:launchpad
Diff against target: 32 lines (+4/-4)
2 files modified
lib/lp/soyuz/interfaces/packageset.py (+2/-2)
lib/lp/soyuz/model/packageset.py (+2/-2)
To merge this branch: bzr merge lp:~wgrant/launchpad/bug-690356
Reviewer Review Type Date Requested Status
Robert Collins (community) Approve
Review via email: mp+52316@code.launchpad.net

Commit message

[r=lifeless][bug=690356] Don't arbitrarily limit the number of packages returned by PackagesetSet.get().

Description of the change

PackagesetSet.get (used as the default collection content on the API) arbitrarily returns only 50 Packagesets. This prevents webservice users from obtaining all sets.

This branch removes the limit from the model and interface, allowing callers to use normal slices.

To post a comment you must log in.
Revision history for this message
Robert Collins (lifeless) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'lib/lp/soyuz/interfaces/packageset.py'
2--- lib/lp/soyuz/interfaces/packageset.py 2011-02-24 15:30:54 +0000
3+++ lib/lp/soyuz/interfaces/packageset.py 2011-03-06 06:51:16 +0000
4@@ -410,8 +410,8 @@
5 """
6
7 @collection_default_content()
8- def get(limit=50):
9- """Return the first `limit` package sets in Launchpad.
10+ def get():
11+ """Return all of the package sets in Launchpad.
12
13 :return: A (potentially empty) sequence of `IPackageset` instances.
14 """
15
16=== modified file 'lib/lp/soyuz/model/packageset.py'
17--- lib/lp/soyuz/model/packageset.py 2010-11-09 08:38:23 +0000
18+++ lib/lp/soyuz/model/packageset.py 2011-03-06 06:51:16 +0000
19@@ -408,11 +408,11 @@
20 result_set = store.find(Packageset, Packageset.owner == owner)
21 return _order_result_set(result_set)
22
23- def get(self, limit=50):
24+ def get(self):
25 """See `IPackagesetSet`."""
26 store = IStore(Packageset)
27 result_set = store.find(Packageset)
28- return _order_result_set(result_set)[:limit]
29+ return _order_result_set(result_set)
30
31 def _nameToSourcePackageName(self, source_name):
32 """Helper to convert a possible string name to ISourcePackageName."""