← Back to team overview

launchpad-reviewers team mailing list archive

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

 

William Grant has proposed merging lp:~wgrant/launchpad/bug-690356 into lp:launchpad.

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)
Related bugs:
  #690356 The "xubuntu" packageset is missing in the lp.packagesets collection (LP API)
  https://bugs.launchpad.net/bugs/690356

For more details, see:
https://code.launchpad.net/~wgrant/launchpad/bug-690356/+merge/52316

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.
-- 
https://code.launchpad.net/~wgrant/launchpad/bug-690356/+merge/52316
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~wgrant/launchpad/bug-690356 into lp:launchpad.
=== modified file 'lib/lp/soyuz/interfaces/packageset.py'
--- lib/lp/soyuz/interfaces/packageset.py	2011-02-24 15:30:54 +0000
+++ lib/lp/soyuz/interfaces/packageset.py	2011-03-06 06:51:16 +0000
@@ -410,8 +410,8 @@
         """
 
     @collection_default_content()
-    def get(limit=50):
-        """Return the first `limit` package sets in Launchpad.
+    def get():
+        """Return all of the package sets in Launchpad.
 
         :return: A (potentially empty) sequence of `IPackageset` instances.
         """

=== modified file 'lib/lp/soyuz/model/packageset.py'
--- lib/lp/soyuz/model/packageset.py	2010-11-09 08:38:23 +0000
+++ lib/lp/soyuz/model/packageset.py	2011-03-06 06:51:16 +0000
@@ -408,11 +408,11 @@
         result_set = store.find(Packageset, Packageset.owner == owner)
         return _order_result_set(result_set)
 
-    def get(self, limit=50):
+    def get(self):
         """See `IPackagesetSet`."""
         store = IStore(Packageset)
         result_set = store.find(Packageset)
-        return _order_result_set(result_set)[:limit]
+        return _order_result_set(result_set)
 
     def _nameToSourcePackageName(self, source_name):
         """Helper to convert a possible string name to ISourcePackageName."""