Merge lp:~cody-somerville/launchpad/export-newSeries-via-api into lp:launchpad

Proposed by Cody A.W. Somerville on 2010-04-23
Status: Merged
Approved by: Curtis Hovey on 2010-04-23
Approved revision: no longer in the source branch.
Merged at revision: 10768
Proposed branch: lp:~cody-somerville/launchpad/export-newSeries-via-api
Merge into: lp:launchpad
Diff against target: 51 lines (+22/-1)
2 files modified
lib/lp/registry/interfaces/product.py (+5/-0)
lib/lp/registry/stories/webservice/xx-project-registry.txt (+17/-1)
To merge this branch: bzr merge lp:~cody-somerville/launchpad/export-newSeries-via-api
Reviewer Review Type Date Requested Status
Curtis Hovey (community) 2010-04-23 Approve on 2010-04-23
Review via email: mp+23978@code.launchpad.net

Commit Message

Export newSeries method via webservices API to permit the creation of new project series.

Description of the Change

Export newSeries method on Project entities to permit the creation of new project series.

To post a comment you must log in.
Curtis Hovey (sinzui) wrote :

Perfect. Thanks for doing this.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'lib/lp/registry/interfaces/product.py'
2--- lib/lp/registry/interfaces/product.py 2010-04-19 15:13:39 +0000
3+++ lib/lp/registry/interfaces/product.py 2010-04-23 03:08:25 +0000
4@@ -273,6 +273,11 @@
5 class IProductDriverRestricted(Interface):
6 """`IProduct` properties which require launchpad.Driver permission."""
7
8+ @call_with(owner=REQUEST_USER)
9+ @rename_parameters_as(releasefileglob="release_url_pattern")
10+ @export_factory_operation(
11+ IProductSeries, ['name', 'summary', 'branch', 'releasefileglob'])
12+ @export_operation_as('newSeries')
13 def newSeries(owner, name, summary, branch=None, releasefileglob=None):
14 """Creates a new `IProductSeries` for this `IProduct`.
15
16
17=== modified file 'lib/lp/registry/stories/webservice/xx-project-registry.txt'
18--- lib/lp/registry/stories/webservice/xx-project-registry.txt 2010-03-17 04:05:42 +0000
19+++ lib/lp/registry/stories/webservice/xx-project-registry.txt 2010-04-23 03:08:25 +0000
20@@ -291,6 +291,17 @@
21 >>> print series['total_size']
22 2
23
24+"newSeries" permits the creation of new series.
25+
26+ >>> experimental_new_series = webservice.named_post(
27+ ... firefox['self_link'], "newSeries", name="experimental",
28+ ... summary="An experimental new series.")
29+ >>> print experimental_new_series
30+ HTTP/1.1 201 Created
31+ ...
32+ Location: http://.../firefox/experimental
33+ ...
34+
35 A list of releases can be accessed through the releases_collection_link.
36
37 >>> response = webservice.get(firefox['releases_collection_link'])
38@@ -445,7 +456,12 @@
39 ... include_inactive=True).jsonBody()
40 >>> print pretty(timeline)
41 [{u'is_development_focus': False,
42- u'landmarks': [{u'code_name': u'First Stable Release',
43+ u'landmarks': [],
44+ u'name': u'experimental',
45+ u'status': u'Active Development',
46+ u'uri': u'/firefox/experimental'},
47+ {u'is_development_focus': False,
48+ u'landmarks': [{u'code_name': u'First Stable Release',
49 u'date': u'2004-06-28',
50 u'name': u'1.0.0',
51 u'type': u'release',