~launchpad-pqm/launchpad/devel

« back to all changes in this revision

Viewing changes to lib/lp/soyuz/model/packagecopyjob.py

  • Committer: Julian Edwards
  • Date: 2011-12-22 15:25:55 UTC
  • mto: This revision was merged to the branch mainline in revision 14591.
  • Revision ID: julian.edwards@canonical.com-20111222152555-fcu2l7ywmdb3ipjm
Add PackageCopyJob.getIncompleteJobsForArchive() method in preparation for showing them on the PPA page

Show diffs side-by-side

added added

removed removed

Lines of Context:
361
361
            result.setdefault(job.package_name, job)
362
362
        return result
363
363
 
 
364
    @classmethod
 
365
    def getIncompleteJobsForArchive(cls, archive):
 
366
        """See `IPlainPackageCopyJobSource`."""
 
367
        jobs = IStore(PackageCopyJob).find(
 
368
            PackageCopyJob,
 
369
            PackageCopyJob.target_archive == archive,
 
370
            PackageCopyJob.job_type == cls.class_job_type,
 
371
            Job.id == PackageCopyJob.job_id,
 
372
            Job._status.is_in(
 
373
                [JobStatus.WAITING, JobStatus.RUNNING, JobStatus.FAILED])
 
374
            )
 
375
        return DecoratedResultSet(jobs, cls)
 
376
 
364
377
    @property
365
378
    def target_pocket(self):
366
379
        return PackagePublishingPocket.items[self.metadata['target_pocket']]