Fixed #23623 -- Reduced memory consumption when generating ModelChoiceField choices