Fixed #29159 -- Made ModelChoiceIterator reuse QuerySet result cache.
When __len__() is called (e.g. when casting to list or tuple), the QuerySet is evaluated and the result cache populated. iterator() shouldn't be called on the QuerySet after that, as it would reset the result cache and trigger a second query.
Showing
Please
register
or
sign in
to comment