~launchpad-pqm/launchpad/devel

« back to all changes in this revision

Viewing changes to lib/lp/soyuz/interfaces/packageset.py

Add DistroSeriesInitializeView.rebuilding_allowed.

Show diffs side-by-side

added added

removed removed

Lines of Context:
14
14
    'NoSuchPackageSet',
15
15
    ]
16
16
 
17
 
import httplib
18
 
 
19
17
from lazr.restful.declarations import (
20
18
    collection_default_content,
21
 
    error_status,
22
19
    export_as_webservice_collection,
23
20
    export_as_webservice_entry,
24
21
    export_factory_operation,
29
26
    operation_parameters,
30
27
    operation_returns_collection_of,
31
28
    operation_returns_entry,
 
29
    webservice_error,
32
30
    )
33
31
from lazr.restful.fields import Reference
34
32
from lazr.restful.interface import copy_field
52
50
 
53
51
class NoSuchPackageSet(NameLookupFailed):
54
52
    """Raised when we try to look up an PackageSet that doesn't exist."""
 
53
    # Bad request.
 
54
    webservice_error(400)
55
55
    _message_prefix = "No such package set (in the specified distro series)"
56
56
 
57
57
 
58
 
@error_status(httplib.BAD_REQUEST)
59
58
class DuplicatePackagesetName(Exception):
60
59
    """Raised for packagesets with the same name and distroseries."""
 
60
    # Bad request.
 
61
    webservice_error(400)
61
62
 
62
63
 
63
64
class IPackagesetViewOnly(IHasOwner):
445
446
        :return: An iterable collection of `IPackageset` instances.
446
447
        """
447
448
 
448
 
    def getForPackages(distroseries, sourcepackagename_ids):
449
 
        """Get `Packagesets` that directly contain the given packages.
450
 
 
451
 
        :param distroseries: `DistroSeries` to look in.  Only packagesets for
452
 
            this series will be returned.
453
 
        :param sourcepackagename_ids: A sequence of `SourcePackageName` ids.
454
 
            Only packagesets for these package names will be returned.
455
 
        :return: A dict mapping `SourcePackageName` ids to lists of their
456
 
            respective packagesets, in no particular order.
457
 
        """
458
 
 
459
449
    @operation_parameters(
460
450
        sourcepackagename=TextLine(
461
451
            title=_('Source package name'), required=True),