1443
1443
return conflicts.one()
1445
def getBuildsForSources(self, distroseries, status=None, pockets=None,
1447
"""See `IPackageUploadSet`."""
1448
# Avoiding circular imports.
1449
from lp.registry.model.distroseries import DistroSeries
1450
from lp.soyuz.model.binarypackagebuild import BinaryPackageBuild
1451
from lp.soyuz.model.sourcepackagerelease import SourcePackageRelease
1453
archives = distroseries.distribution.getArchiveIDList()
1455
DistroSeries.id == PackageUpload.distroseriesID,
1456
PackageUpload.archiveID.is_in(archives),
1457
PackageUploadBuild.packageuploadID == PackageUpload.id,
1460
if status is not None:
1461
clauses.append(PackageUpload.status.is_in(status))
1462
if pockets is not None:
1463
clauses.append(PackageUpload.pocket.is_in(pockets))
1464
if names is not None:
1466
BinaryPackageBuild.id == PackageUploadBuild.buildID,
1467
BinaryPackageBuild.source_package_release ==
1468
SourcePackageRelease.id,
1469
SourcePackageRelease.sourcepackagename ==
1470
SourcePackageName.id,
1471
SourcePackageName.name.is_in(names),
1474
store = IStore(PackageUpload)
1475
return store.find(PackageUpload, *clauses)
1445
1477
def count(self, status=None, distroseries=None, pocket=None):
1446
1478
"""See `IPackageUploadSet`."""