~launchpad-pqm/launchpad/devel

« back to all changes in this revision

Viewing changes to lib/lp/registry/model/distroseriesparent.py

[r=julian-edwards][bug=789091] Fix InitialiseDistroSeries so that it
        actually initializes a derived series from multiple parents.

Show diffs side-by-side

added added

removed removed

Lines of Context:
55
55
    component_id = Int(name='component', allow_none=True)
56
56
    component = Reference(component_id, 'Component.id')
57
57
 
 
58
    ordering = Int(allow_none=False, default=1)
 
59
 
58
60
 
59
61
class DistroSeriesParentSet:
60
62
    """See `IDistroSeriesParentSet`."""
62
64
    title = "Cross reference of parent and derived distroseries."
63
65
 
64
66
    def new(self, derived_series, parent_series, initialized,
65
 
            is_overlay=False, pocket=None, component=None):
 
67
            is_overlay=False, pocket=None, component=None, ordering=1):
66
68
        """Make and return a new `DistroSeriesParent`."""
67
69
        store = IMasterStore(DistroSeriesParent)
68
70
        dsp = DistroSeriesParent()
72
74
        dsp.is_overlay = is_overlay
73
75
        dsp.pocket = pocket
74
76
        dsp.component = component
 
77
        dsp.ordering = ordering
75
78
        store.add(dsp)
76
79
        return dsp
77
80