launchpad-reviewers team mailing list archive
-
launchpad-reviewers team
-
Mailing list archive
-
Message #15734
[Merge] lp:~stevenk/launchpad/drs-for-getsourcesfordeletion into lp:launchpad
Steve Kowalik has proposed merging lp:~stevenk/launchpad/drs-for-getsourcesfordeletion into lp:launchpad.
Requested reviews:
Launchpad code reviewers (launchpad-reviewers)
For more details, see:
https://code.launchpad.net/~stevenk/launchpad/drs-for-getsourcesfordeletion/+merge/176149
Rather than calling load_related() for every single source publication in IArchive.getSourcesForDeletion(), make use of DecoratedResultSet instead.
--
https://code.launchpad.net/~stevenk/launchpad/drs-for-getsourcesfordeletion/+merge/176149
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~stevenk/launchpad/drs-for-getsourcesfordeletion into lp:launchpad.
=== modified file 'lib/lp/soyuz/model/archive.py'
--- lib/lp/soyuz/model/archive.py 2013-07-16 08:10:32 +0000
+++ lib/lp/soyuz/model/archive.py 2013-07-22 09:48:30 +0000
@@ -628,8 +628,10 @@
SourcePackagePublishingHistory, *clauses).order_by(
SourcePackageName.name, Desc(SourcePackageRelease.version),
Desc(SourcePackagePublishingHistory.id))
- load_related(SourcePackageRelease, sources, ['sourcepackagereleaseID'])
- return sources
+ def eager_load(rows):
+ load_related(
+ SourcePackageRelease, rows, ['sourcepackagereleaseID'])
+ return DecoratedResultSet(sources, pre_iter_hook=eager_load)
@property
def number_of_sources(self):