launchpad-dev team mailing list archive
-
launchpad-dev team
-
Mailing list archive
-
Message #06331
Re: bug api questions
On 28 January 2011 02:14, Deryck Hodge <deryck.hodge@xxxxxxxxxxxxx> wrote:
> Hi, Martin.
>
> On Wed, Jan 26, 2011 at 11:06 PM, Martin Pool <mbp@xxxxxxxxxxxxx> wrote:
>> 1- How do I, through the API, get a list of all bugs assigned to a
>> person, across all pillars?
>>
>
> As Markus notes, using searchTasks on the person is the way to get this.
Thanks. Sadly it seems to often timeout at the moment because of
<https://bugs.launchpad.net/launchpad/+bug/669766> but perhaps I can
find an invocation that will work.
>
>> 2- It seems like it would be clean and consistent with other apis to
>> have person.assigned_tasks_collection_link. Am I misunderstanding
>> something about the API design that explains why it's not there, or is
>> it just accidental? Would it be easy to add one?
>>
>
> It's not there because there is no attribute on a person for assigned
> bugs. The list of assigned bugs is generated by a view, which really
> just hooks around searchTasks the same as you have to do with the API.
> The API is hooked to our model code, not view code, which is why this
> is left out. To expose this in the API, you would need create such an
> attribute for a person and then export it.
>
> Hope that helps.
Thanks, that does help. It's not really urgent but I'm curious
whether it would be considered more tasteful to add those collections
in to the model. In some other classes that to me seem comparable,
they are present.
I guess the catch is that you will sometimes want to restrict it and
not get just all the bugs ever assigned to the person. But having a
url you can then restrict seems to fit in quite a nice way with the ws
peformance lep.
--
Martin
References