Merge lp:~jml/launchpad/expose-get-owners into lp:launchpad

Proposed by Jonathan Lange
Status: Rejected
Rejected by: Jonathan Lange
Proposed branch: lp:~jml/launchpad/expose-get-owners
Merge into: lp:launchpad
Diff against target: 60 lines (+24/-0) (has conflicts)
3 files modified
lib/lp/registry/interfaces/person.py (+9/-0)
lib/lp/registry/interfaces/pillar.py (+3/-0)
lib/lp/registry/stories/webservice/xx-person.txt (+12/-0)
Text conflict in lib/lp/registry/interfaces/person.py
To merge this branch: bzr merge lp:~jml/launchpad/expose-get-owners
Reviewer Review Type Date Requested Status
Jonathan Lange (community) Needs Fixing
Review via email: mp+21150@code.launchpad.net

Description of the change

I just found this branch in my area. It looks pretty sensible to me, so I figure it should get reviewed.

jml

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

From the bug report:

jml says "Note that exposing this method, which should be a very, very simple patch, is actually quite tedious. The method in question returns IPillarName, which is itself not exposed via the API yet"

leonardr replies "You don't need to publish internal Launchpad methods exactly as is. You should be able to define a new method that returns pillar objects (which are already published), and publish that as a named operation."

Also there are conflicts.

review: Needs Fixing

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'lib/lp/registry/interfaces/person.py'
2--- lib/lp/registry/interfaces/person.py 2010-03-05 14:50:47 +0000
3+++ lib/lp/registry/interfaces/person.py 2010-03-11 15:39:31 +0000
4@@ -88,6 +88,13 @@
5 IHasBranches, IHasMergeProposals, IHasRequestedReviews)
6 from lp.registry.interfaces.irc import IIrcID
7 from lp.registry.interfaces.jabber import IJabberID
8+<<<<<<< TREE
9+=======
10+from lp.registry.interfaces.pillar import IPillarName
11+from lp.services.worlddata.interfaces.language import ILanguage
12+from canonical.launchpad.interfaces.launchpad import (
13+ IHasIcon, IHasLogo, IHasMugshot, IPrivacy)
14+>>>>>>> MERGE-SOURCE
15 from lp.registry.interfaces.location import (
16 IHasLocation, ILocationRecord, IObjectWithLocation, ISetLocation)
17 from lp.registry.interfaces.mailinglistsubscription import (
18@@ -956,6 +963,8 @@
19 the icons which represent that category.
20 """
21
22+ @operation_returns_collection_of(IPillarName)
23+ @export_read_operation()
24 def getOwnedOrDrivenPillars():
25 """Return Distribution, Project Groups and Projects that this person
26 owns or drives.
27
28=== modified file 'lib/lp/registry/interfaces/pillar.py'
29--- lib/lp/registry/interfaces/pillar.py 2009-06-25 04:06:00 +0000
30+++ lib/lp/registry/interfaces/pillar.py 2010-03-11 15:39:31 +0000
31@@ -65,6 +65,9 @@
32 This includes the pillar object, as well as information about whether
33 it's a project, project group, or distribution.
34 """
35+
36+ export_as_webservice_entry()
37+
38 id = Int(title=_('The PillarName ID'))
39 name = TextLine(title=u"The name.")
40 product = Attribute('The project that has this name, or None')
41
42=== modified file 'lib/lp/registry/stories/webservice/xx-person.txt'
43--- lib/lp/registry/stories/webservice/xx-person.txt 2010-02-24 16:53:30 +0000
44+++ lib/lp/registry/stories/webservice/xx-person.txt 2010-03-11 15:39:31 +0000
45@@ -650,3 +650,15 @@
46 HTTP/1.1 400 Bad Request
47 ...
48 team_owner_link: Constraint not satisfied.
49+
50+
51+== Associated pillars ==
52+
53+A team can own or drive a bunch of projects.
54+
55+ >>> json = webservice.named_get(
56+ ... '/~name12', 'getOwnedOrDrivenPillars').jsonBody()
57+ >>> for entry in json['entries']:
58+ ... print entry
59+
60+