Comment 6 for bug 583318

Revision history for this message
Leonard Richardson (leonardr) wrote :

And here's why CollectionWithKeyBasedLookup always fetches a representation:

        # We don't know what kind of resource this is. Even the
        # subclass doesn't necessarily know, because some resources
        # (the person list) are gateways to more than one kind of
        # resource (people, and teams). The only way to know for sure
        # is to retrieve a representation of the resource and see how
        # the resource describes itself.

For most CollectionWithKeyBasedLookup classes, we can avoid this by specifying the equivalent of resource_type_link in the subclass. But this won't work for PersonCollection, since launchpad.people['leonardr'] has a different resource_type_link than launchpad.people['beta-testers'], and the only way to know this is to make that HTTP request.

So I can fix this easily for projects, bugs, branches, etc. but not for people. I could work up some extra solution for people where something like launchpad.people['team:beta-testers'] would work, but I think that's too much work for the benefit, and I'm not sure how the design would look--obviously 'team:beta-testers' is pretty bad.