summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--django/forms/models.py4
-rw-r--r--django/utils/choices.py6
2 files changed, 5 insertions, 5 deletions
diff --git a/django/forms/models.py b/django/forms/models.py
index d353da4ddc..ff4b83fe59 100644
--- a/django/forms/models.py
+++ b/django/forms/models.py
@@ -21,7 +21,7 @@ from django.forms.widgets import (
RadioSelect,
SelectMultiple,
)
-from django.utils.choices import ChoiceIterator
+from django.utils.choices import BaseChoiceIterator
from django.utils.text import capfirst, get_text_list
from django.utils.translation import gettext
from django.utils.translation import gettext_lazy as _
@@ -1403,7 +1403,7 @@ class ModelChoiceIteratorValue:
return self.value == other
-class ModelChoiceIterator(ChoiceIterator):
+class ModelChoiceIterator(BaseChoiceIterator):
def __init__(self, field):
self.field = field
self.queryset = field.queryset
diff --git a/django/utils/choices.py b/django/utils/choices.py
index ccedf828a0..93a34e403d 100644
--- a/django/utils/choices.py
+++ b/django/utils/choices.py
@@ -3,11 +3,11 @@ from collections.abc import Callable, Iterable, Iterator, Mapping
from django.utils.functional import Promise
-class ChoiceIterator:
+class BaseChoiceIterator:
"""Base class for lazy iterators for choices."""
-class CallableChoiceIterator(ChoiceIterator):
+class CallableChoiceIterator(BaseChoiceIterator):
"""Iterator to lazily normalize choices generated by a callable."""
def __init__(self, func):
@@ -23,7 +23,7 @@ def normalize_choices(value, *, depth=0):
from django.db.models.enums import ChoicesMeta
match value:
- case ChoiceIterator() | Promise() | bytes() | str():
+ case BaseChoiceIterator() | Promise() | bytes() | str():
# Avoid prematurely normalizing iterators that should be lazy.
# Because string-like types are iterable, return early to avoid
# iterating over them in the guard for the Iterable case below.