Merge lp:~jml/launchpad/expose-blueprints into lp:launchpad

Proposed by Jonathan Lange
Status: Rejected
Rejected by: Jonathan Lange
Proposed branch: lp:~jml/launchpad/expose-blueprints
Merge into: lp:launchpad
Diff against target: 70 lines (+35/-6)
2 files modified
lib/canonical/launchpad/pagetests/webservice/xx-specification.txt (+24/-0)
lib/lp/blueprints/interfaces/specification.py (+11/-6)
To merge this branch: bzr merge lp:~jml/launchpad/expose-blueprints
Reviewer Review Type Date Requested Status
Jonathan Lange (community) Approve
Review via email: mp+15060@code.launchpad.net

Commit message

Expose 'drafter' on specifications, and improve the documentation a little.

To post a comment you must log in.
Revision history for this message
Jonathan Lange (jml) wrote :

Expose 'drafter' on specifications, and improve the documentation a little.

Revision history for this message
Matt Zimmerman (mdz) wrote :

This code is awesome. Thank you!

--
 - mdz

Revision history for this message
Jonathan Lange (jml) wrote :

Wow, you are good. Land it right away.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== added file 'lib/canonical/launchpad/pagetests/webservice/xx-specification.txt'
--- lib/canonical/launchpad/pagetests/webservice/xx-specification.txt 1970-01-01 00:00:00 +0000
+++ lib/canonical/launchpad/pagetests/webservice/xx-specification.txt 2009-11-19 21:50:35 +0000
@@ -0,0 +1,24 @@
1
2= Prelude =
3
4 >>> login(ANONYMOUS)
5 >>> specification = factory.makeSpecification()
6 >>> spec_url = canonical_url(specification, rootsite='api')
7 >>> drafter = factory.makePerson()
8 >>> drafter_url = canonical_url(drafter, rootsite='api')
9 >>> logout()
10
11= Specifications =
12
13Specifications are exposed over the API.
14
15 >>> from simplejson import dumps
16 >>> web_spec = webservice.get(spec_url).jsonBody()
17 >>> web_spec['drafter_link'] is None
18 True
19 >>> patch = dict(drafter_link=drafter_url)
20 >>> webservice.patch(
21 ... spec_url, 'application/json', dumps(patch))
22 >>> web_spec = webservice.get(spec_url).jsonBody()
23 >>> web_spec['drafter_link'] == drafter_url
24 True
025
=== modified file 'lib/lp/blueprints/interfaces/specification.py'
--- lib/lp/blueprints/interfaces/specification.py 2009-07-17 00:26:05 +0000
+++ lib/lp/blueprints/interfaces/specification.py 2009-11-19 21:50:35 +0000
@@ -28,7 +28,8 @@
2828
29from lazr.restful.declarations import (29from lazr.restful.declarations import (
30 REQUEST_USER, call_with, export_as_webservice_entry,30 REQUEST_USER, call_with, export_as_webservice_entry,
31 export_write_operation, operation_parameters, operation_returns_entry)31 exported, export_write_operation, operation_parameters,
32 operation_returns_entry)
32from lazr.restful.fields import Reference33from lazr.restful.fields import Reference
33from zope.interface import Interface, Attribute34from zope.interface import Interface, Attribute
34from zope.component import getUtility35from zope.component import getUtility
@@ -586,11 +587,12 @@
586 title=_('Assignee'), required=False,587 title=_('Assignee'), required=False,
587 description=_("The person responsible for implementing the feature."),588 description=_("The person responsible for implementing the feature."),
588 vocabulary='ValidPersonOrTeam')589 vocabulary='ValidPersonOrTeam')
589 drafter = PublicPersonChoice(590 drafter = exported(
590 title=_('Drafter'), required=False,591 PublicPersonChoice(
591 description=_(592 title=_('Drafter'), required=False,
593 description=_(
592 "The person responsible for drafting the specification."),594 "The person responsible for drafting the specification."),
593 vocabulary='ValidPersonOrTeam')595 vocabulary='ValidPersonOrTeam'))
594 approver = PublicPersonChoice(596 approver = PublicPersonChoice(
595 title=_('Approver'), required=False,597 title=_('Approver'), required=False,
596 description=_(598 description=_(
@@ -645,7 +647,10 @@
645647
646class ISpecification(INewSpecification, INewSpecificationTarget, IHasOwner,648class ISpecification(INewSpecification, INewSpecificationTarget, IHasOwner,
647 ICanBeMentored, IHasLinkedBranches):649 ICanBeMentored, IHasLinkedBranches):
648 """A Specification."""650 """A Specification.
651
652 Also known as a blueprint.
653 """
649654
650 export_as_webservice_entry()655 export_as_webservice_entry()
651656