Skip to content

Commit

Permalink
5.0: Update django.forms.formsets (#2145)
Browse files Browse the repository at this point in the history
* 5.0: Update django.forms.formsets

* Improve typing of django.forms.BaseFormSet
  • Loading branch information
JaeHyuckSa authored May 19, 2024
1 parent bcd4bfd commit 9d92914
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 9 deletions.
9 changes: 6 additions & 3 deletions django-stubs/forms/formsets.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@ from typing import Any, Generic, TypeVar

from django.db.models.fields import _ErrorMessagesDict
from django.forms.forms import BaseForm, Form
from django.forms.renderers import BaseRenderer
from django.forms.utils import ErrorList, RenderableFormMixin, _DataT, _FilesT
from django.forms.widgets import Media, Widget
from django.forms.widgets import Media, MediaDefiningClass, Widget
from django.utils.functional import cached_property

TOTAL_FORM_COUNT: str
Expand Down Expand Up @@ -44,8 +45,8 @@ class BaseFormSet(Generic[_F], Sized, RenderableFormMixin):
initial: Sequence[Mapping[str, Any]] | None
form_kwargs: dict[str, Any]
error_class: type[ErrorList]
deletion_widget: type[Widget]
ordering_widget: type[Widget]
deletion_widget: MediaDefiningClass
ordering_widget: MediaDefiningClass
default_error_messages: _ErrorMessagesDict
template_name_div: str
template_name_p: str
Expand All @@ -61,6 +62,8 @@ class BaseFormSet(Generic[_F], Sized, RenderableFormMixin):
error_class: type[ErrorList] = ...,
form_kwargs: dict[str, Any] | None = ...,
error_messages: Mapping[str, str] | None = ...,
form_renderer: BaseRenderer = ...,
renderer: BaseRenderer = ...,
) -> None: ...
def __iter__(self) -> Iterator[_F]: ...
def __getitem__(self, index: int) -> _F: ...
Expand Down
6 changes: 0 additions & 6 deletions scripts/stubtest/allowlist_todo.txt
Original file line number Diff line number Diff line change
Expand Up @@ -407,8 +407,6 @@ django.contrib.gis.db.models.lookups.RasterBandTransform.as_sql
django.contrib.gis.forms.ALL_FIELDS
django.contrib.gis.forms.BaseForm.__init__
django.contrib.gis.forms.BaseFormSet.__init__
django.contrib.gis.forms.BaseFormSet.deletion_widget
django.contrib.gis.forms.BaseFormSet.ordering_widget
django.contrib.gis.forms.BaseModelForm.__init__
django.contrib.gis.forms.BaseModelForm.save_m2m
django.contrib.gis.forms.BaseModelFormSet.model
Expand Down Expand Up @@ -1274,8 +1272,6 @@ django.db.utils.DatabaseErrorWrapper.__call__
django.forms.ALL_FIELDS
django.forms.BaseForm.__init__
django.forms.BaseFormSet.__init__
django.forms.BaseFormSet.deletion_widget
django.forms.BaseFormSet.ordering_widget
django.forms.BaseModelForm.__init__
django.forms.BaseModelForm.save_m2m
django.forms.BaseModelFormSet.model
Expand Down Expand Up @@ -1322,8 +1318,6 @@ django.forms.forms.BaseForm.__init__
django.forms.forms.DeclarativeFieldsMetaclass.__new__
django.forms.formset_factory
django.forms.formsets.BaseFormSet.__init__
django.forms.formsets.BaseFormSet.deletion_widget
django.forms.formsets.BaseFormSet.ordering_widget
django.forms.formsets.ManagementForm.__init__
django.forms.formsets.formset_factory
django.forms.inlineformset_factory
Expand Down

0 comments on commit 9d92914

Please sign in to comment.