launchpad-dev team mailing list archive
-
launchpad-dev team
-
Mailing list archive
-
Message #09227
Re: Help please - launchpadlib collections
On 12/04/12 11:17, Ian Booth wrote:
> Hi James
>
>>
>> Firstly I wanted to note that lp.projects is a heterogenous collection
>> isn't it? You can access both projects and project groups with it, and
>> don't they have a different interface?
>>
>
> AFAIK, project groups are handled separately, using lp.project_groups
lp.projects['fooprojectgroup'] happens to work because launchpadlib's
ProjectSet generates a URL of /fooprojectgroup, and that URL namespace
is shared between projects, distributions and project groups. The
returned interfaces are heterogeneous because of exactly the hack that
Ian proposes as the easy solution -- indexing a client-defined
collection like ProjectSet just generates a URL with a known structure
and requests that resource, respecting whatever resource type is returned.
Attachment:
signature.asc
Description: OpenPGP digital signature
Follow ups
References