On Wednesday 25 November 2015 20:34:11 Marc Tamlyn wrote: > I can see a use for this, but the API is unsure. Given that from a > performance point of view it should be possible to do this as a transform > after a values query (in most cases using a similar lazy sequence-like > object will maintain the performance you need), can I propose implementing > it as an external app to find a good API. Once this has been done, we can > look at how buildable that API is at a lower level to get the maximum > performance. >
That sounds like a good plan to me. I would just like to add that, since we're talking about values() queries where no model instances are constructed, one possible API is to have just a single boolean `nested` argument, where the selection of which FKs to expand is implied by select_related() calls. Shai.