~launchpad-pqm/launchpad/devel

« back to all changes in this revision

Viewing changes to lib/lp/code/model/sourcepackagerecipebuild.py

  • Committer: Stuart Bishop
  • Date: 2011-11-14 07:51:26 UTC
  • mfrom: (14291 devel)
  • mto: This revision was merged to the branch mainline in revision 14299.
  • Revision ID: stuart.bishop@canonical.com-20111114075126-8jhoq57i2qphmch1
Merged rocketfuel into trivial.

Show diffs side-by-side

added added

removed removed

Lines of Context:
23
23
    Reference,
24
24
    Storm,
25
25
    )
26
 
from storm.store import Store
 
26
from storm.store import (
 
27
    EmptyResultSet,
 
28
    Store,
 
29
    )
27
30
from zope.component import getUtility
28
31
from zope.interface import (
29
32
    classProvides,
280
283
            PackageBuild.build_farm_job_id == build_farm_job.id).one()
281
284
 
282
285
    @classmethod
 
286
    def getByBuildFarmJobs(cls, build_farm_jobs):
 
287
        """See `ISpecificBuildFarmJobSource`."""
 
288
        if len(build_farm_jobs) == 0:
 
289
            return EmptyResultSet()
 
290
        build_farm_job_ids = [
 
291
            build_farm_job.id for build_farm_job in build_farm_jobs]
 
292
        return Store.of(build_farm_jobs[0]).find(cls,
 
293
            cls.package_build_id == PackageBuild.id,
 
294
            PackageBuild.build_farm_job_id.is_in(build_farm_job_ids))
 
295
 
 
296
    @classmethod
283
297
    def getRecentBuilds(cls, requester, recipe, distroseries, _now=None):
284
298
        from lp.buildmaster.model.buildfarmjob import BuildFarmJob
285
299
        if _now is None: