diff options
| author | Charles Roelli <charles@aurox.ch> | 2026-05-05 09:24:59 +0000 |
|---|---|---|
| committer | Charles Roelli <charles@aurox.ch> | 2026-05-05 09:24:59 +0000 |
| commit | b3c1fd51b6537c122b8ead6aa9234685560866d8 (patch) | |
| tree | 544c306118205eb54bbd1ab97d3ea5e863dfc913 /docs/ref/forms | |
| parent | 9f790ef1a0f356cf6342b5d57bbaeac35aed0d9f (diff) | |
Fixed #31295 -- Avoided Select widget triggering additional query when using ModelChoiceIterator.fix-31295
Diffstat (limited to 'docs/ref/forms')
| -rw-r--r-- | docs/ref/forms/fields.txt | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/docs/ref/forms/fields.txt b/docs/ref/forms/fields.txt index 8ddc5b9d79..6186f7d4e8 100644 --- a/docs/ref/forms/fields.txt +++ b/docs/ref/forms/fields.txt @@ -1619,12 +1619,16 @@ customize the yielded 2-tuple choices. ``ModelChoiceIterator`` has the following method: - .. method:: __iter__() + .. method:: generator() Yields 2-tuple choices, in the ``(value, label)`` format used by :attr:`ChoiceField.choices`. The first ``value`` element is a :class:`ModelChoiceIteratorValue` instance. + .. versionchanged:: 6.1 + + ``generator`` yields choices instead of ``__iter__``. + ``ModelChoiceIteratorValue`` ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
