Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix BaseModelForm, ErrorList, ErrorDict __init__(renderer=) parameter #1690

Merged
merged 2 commits into from
Oct 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion django-stubs/forms/models.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ class BaseModelForm(Generic[_M], BaseForm):
empty_permitted: bool = ...,
instance: _M | None = ...,
use_required_attribute: bool | None = ...,
renderer: BaseRenderer = ...,
renderer: BaseRenderer | None = ...,
) -> None: ...
def validate_unique(self) -> None: ...
def save(self, commit: bool = ...) -> _M: ...
Expand Down
2 changes: 2 additions & 0 deletions django-stubs/forms/utils.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ class ErrorDict(dict[str, ErrorList], RenderableErrorMixin):
template_name_ul: str
renderer: BaseRenderer

def __init__(self, *args: Any, renderer: BaseRenderer | None = None, **kwargs: Any): ...
def as_data(self) -> dict[str, list[ValidationError]]: ...
def get_json_data(self, escape_html: bool = ...) -> dict[str, Any]: ...

Expand All @@ -59,6 +60,7 @@ class ErrorList(UserList[ValidationError | _StrOrPromise], RenderableErrorMixin)
self,
initlist: ErrorList | Sequence[str | Exception] | None = ...,
error_class: str | None = ...,
renderer: BaseRenderer | None = ...,
) -> None: ...
def as_data(self) -> list[ValidationError]: ...
def get_json_data(self, escape_html: bool = ...) -> list[dict[str, str]]: ...
Expand Down
2 changes: 0 additions & 2 deletions scripts/stubtest/allowlist_todo.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2093,8 +2093,6 @@ django.forms.renderers.DjangoDivFormRenderer
django.forms.renderers.EngineMixin.engine
django.forms.renderers.Jinja2.backend
django.forms.utils.DEFAULT_TEMPLATE_DEPRECATION_MSG
django.forms.utils.ErrorDict.__init__
django.forms.utils.ErrorList.__init__
django.forms.widgets.ChoiceWidget.__deepcopy__
django.forms.widgets.ChoiceWidget.subwidgets
django.forms.widgets.ChoiceWidget.template_name
Expand Down