~launchpad-pqm/launchpad/devel

« back to all changes in this revision

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

Merged recipe-collection into buildqueue-creation.

Show diffs side-by-side

added added

removed removed

Lines of Context:
24
24
from lp.buildmaster.interfaces.buildfarmjob import BuildFarmJobType
25
25
from lp.buildmaster.model.buildbase import BuildBase
26
26
from lp.services.job.model.job import Job
 
27
from lp.registry.interfaces.pocket import PackagePublishingPocket
 
28
from lp.soyuz.adapters.archivedependencies import (
 
29
    default_component_dependency_name,)
27
30
from lp.soyuz.interfaces.build import BuildStatus
 
31
from lp.soyuz.interfaces.component import IComponentSet
28
32
from lp.soyuz.interfaces.sourcepackagerecipebuild import (
29
33
    ISourcePackageRecipeBuildJob, ISourcePackageRecipeBuildJobSource,
30
34
    ISourcePackageRecipeBuild, ISourcePackageRecipeBuildSource)
55
59
    build_state = EnumCol(
56
60
        dbName='build_state', notNull=True, schema=BuildStatus)
57
61
 
 
62
    @property
 
63
    def current_component(self):
 
64
        return getUtility(IComponentSet)[default_component_dependency_name]
 
65
 
58
66
    date_created = UtcDateTimeCol(notNull=True)
59
67
    date_built = UtcDateTimeCol(notNull=False)
60
68
    date_first_dispatched = UtcDateTimeCol(notNull=False)
66
74
    sourcepackagename = Reference(
67
75
        sourcepackagename_id, 'SourcePackageName.id')
68
76
 
 
77
    @property
 
78
    def pocket(self):
 
79
        # JRV 2010-01-15: The database table really should have a pocket 
 
80
        # column, although this is not a big problem at the moment 
 
81
        # as recipe builds only happen for PPA's (so far). (bug 507307)
 
82
        return PackagePublishingPocket.RELEASE
 
83
 
69
84
    recipe_id = Int(name='recipe', allow_none=False)
70
85
    recipe = Reference(recipe_id, 'SourcePackageRecipe.id')
71
86