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
=== modified file 'lib/lp/registry/interfaces/person.py'
--- lib/lp/registry/interfaces/person.py 2010-03-05 14:50:47 +0000
+++ lib/lp/registry/interfaces/person.py 2010-03-11 15:39:31 +0000
@@ -88,6 +88,13 @@
88 IHasBranches, IHasMergeProposals, IHasRequestedReviews)88 IHasBranches, IHasMergeProposals, IHasRequestedReviews)
89from lp.registry.interfaces.irc import IIrcID89from lp.registry.interfaces.irc import IIrcID
90from lp.registry.interfaces.jabber import IJabberID90from lp.registry.interfaces.jabber import IJabberID
91<<<<<<< TREE
92=======
93from lp.registry.interfaces.pillar import IPillarName
94from lp.services.worlddata.interfaces.language import ILanguage
95from canonical.launchpad.interfaces.launchpad import (
96 IHasIcon, IHasLogo, IHasMugshot, IPrivacy)
97>>>>>>> MERGE-SOURCE
91from lp.registry.interfaces.location import (98from lp.registry.interfaces.location import (
92 IHasLocation, ILocationRecord, IObjectWithLocation, ISetLocation)99 IHasLocation, ILocationRecord, IObjectWithLocation, ISetLocation)
93from lp.registry.interfaces.mailinglistsubscription import (100from lp.registry.interfaces.mailinglistsubscription import (
@@ -956,6 +963,8 @@
956 the icons which represent that category.963 the icons which represent that category.
957 """964 """
958965
966 @operation_returns_collection_of(IPillarName)
967 @export_read_operation()
959 def getOwnedOrDrivenPillars():968 def getOwnedOrDrivenPillars():
960 """Return Distribution, Project Groups and Projects that this person969 """Return Distribution, Project Groups and Projects that this person
961 owns or drives.970 owns or drives.
962971
=== modified file 'lib/lp/registry/interfaces/pillar.py'
--- lib/lp/registry/interfaces/pillar.py 2009-06-25 04:06:00 +0000
+++ lib/lp/registry/interfaces/pillar.py 2010-03-11 15:39:31 +0000
@@ -65,6 +65,9 @@
65 This includes the pillar object, as well as information about whether65 This includes the pillar object, as well as information about whether
66 it's a project, project group, or distribution.66 it's a project, project group, or distribution.
67 """67 """
68
69 export_as_webservice_entry()
70
68 id = Int(title=_('The PillarName ID'))71 id = Int(title=_('The PillarName ID'))
69 name = TextLine(title=u"The name.")72 name = TextLine(title=u"The name.")
70 product = Attribute('The project that has this name, or None')73 product = Attribute('The project that has this name, or None')
7174
=== modified file 'lib/lp/registry/stories/webservice/xx-person.txt'
--- lib/lp/registry/stories/webservice/xx-person.txt 2010-02-24 16:53:30 +0000
+++ lib/lp/registry/stories/webservice/xx-person.txt 2010-03-11 15:39:31 +0000
@@ -650,3 +650,15 @@
650 HTTP/1.1 400 Bad Request650 HTTP/1.1 400 Bad Request
651 ...651 ...
652 team_owner_link: Constraint not satisfied.652 team_owner_link: Constraint not satisfied.
653
654
655== Associated pillars ==
656
657A team can own or drive a bunch of projects.
658
659 >>> json = webservice.named_get(
660 ... '/~name12', 'getOwnedOrDrivenPillars').jsonBody()
661 >>> for entry in json['entries']:
662 ... print entry
663
664