873
874
clause_tables = (BinaryPackageBuild, PackageBuild, BuildFarmJob)
874
875
build_farm_job_ids = [
875
876
build_farm_job.id for build_farm_job in build_farm_jobs]
876
return Store.of(build_farm_jobs[0]).using(*clause_tables).find(
878
def eager_load(rows):
880
from lp.registry.model.sourcepackagename import (
883
from lp.soyuz.model.sourcepackagerelease import (
886
from lp.soyuz.model.distroarchseries import (
889
from lp.registry.model.distroseries import (
892
from lp.registry.model.distribution import (
895
from lp.soyuz.model.archive import Archive
897
SourcePackageRelease, rows, ['source_package_release_id'])
899
SourcePackageName, sprs, ['sourcepackagenameID'])
900
distro_arch_series = load_related(
901
DistroArchSeries, rows, ['distro_arch_series_id'])
902
package_builds = load_related(
903
PackageBuild, rows, ['package_build_id'])
905
Archive, package_builds, ['archive_id'])
906
distroseries = load_related(
907
DistroSeries, distro_arch_series, ['distroseriesID'])
909
Distribution, distroseries, ['distributionID'])
910
resultset = Store.of(build_farm_jobs[0]).using(*clause_tables).find(
877
911
BinaryPackageBuild,
878
912
BinaryPackageBuild.package_build == PackageBuild.id,
879
913
PackageBuild.build_farm_job == BuildFarmJob.id,
880
914
BuildFarmJob.id.is_in(build_farm_job_ids))
915
return DecoratedResultSet(resultset, pre_iter_hook=eager_load)
882
917
def getPendingBuildsForArchSet(self, archseries):
883
918
"""See `IBinaryPackageBuildSet`."""