BYK/pyresto — Issue #8: Lazy loading for Many relationship
Author: BYK
Created: 2011-10-10 19:58:51+00:00
State: open

In the current implementation, when an api response provides a "continuation url" like GitHub does in the "Link" header under the name of "next", Model._rest_call method calls all the continuation urls iteratively and returns a merged result using the "+" operator. Although this approach is usually good, in some cases like getting all commits of a project, it takes too much time and usually unncessary resources since the needed subset of commits are usually the ones on the first "pages".

What needs to be done is to make this behavior at least optional or to switch to a "lazy loading" model where the current "WrappedList" approach may be replaced with an "iterator" approach. The first part needing change is the Model._rest_call method and the second part is the Many relationship.