1
0
mirror of https://github.com/django/django.git synced 2025-10-31 09:41:08 +00:00

Refs #31262 -- Renamed ChoiceIterator to BaseChoiceIterator.

Some third-party applications, e.g. `django-filter`, already define
their own `ChoiceIterator`, so renaming this `BaseChoiceIterator` will
be a better fit and avoid any potential confusion.

See https://github.com/carltongibson/django-filter/pull/1607.
This commit is contained in:
Nick Pope
2023-09-04 12:56:50 +01:00
committed by GitHub
parent a534835c7b
commit 8c8cbe66fa
2 changed files with 5 additions and 5 deletions

View File

@@ -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