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

5.0: Update django.forms.formsets #2145

Merged
merged 2 commits into from
May 19, 2024

Conversation

JaeHyuckSa
Copy link
Contributor

@JaeHyuckSa JaeHyuckSa commented May 10, 2024

I have made things!

Update stubs for django.forms.formsets for Django 5.0.

  • django.forms.formsets
    • django.forms.formsets.BaseFormSet.form_renderer was added
    • django.forms.formsets.BaseFormSet.renderer was added

Related issues

Refs

Upstream PR

@sudosubin sudosubin mentioned this pull request May 11, 2024
39 tasks
@sobolevn
Copy link
Member

Btw, why there's no stubtest change?

@JaeHyuckSa
Copy link
Contributor Author

Btw, why there's no stubtest change?

I've checked on that issue but I couldn't find it. Is there anything I'm missing?

Copy link
Member

@sobolevn sobolevn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please, fix them:

django.forms.BaseFormSet.__init__
django.forms.BaseFormSet.deletion_widget
django.forms.BaseFormSet.ordering_widget

@JaeHyuckSa
Copy link
Contributor Author

JaeHyuckSa commented May 16, 2024

Please, fix them:

django.forms.BaseFormSet.__init__
django.forms.BaseFormSet.deletion_widget
django.forms.BaseFormSet.ordering_widget

I attempted to modify the__init__ as you suggested, but encountered an error with the error_class. I resolved it by applying ABCMeta, but I'm not entirely sure if this is the correct approach.

error: django.forms.BaseFormSet.__init__ is inconsistent,
runtime argument "error_class" has a default value of type abc.ABCMeta,
which is incompatible with stub argument type type[django.forms.utils.ErrorList]
error_class: ABCMeta

Copy link
Member

@sobolevn sobolevn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, let's keep __init__ ignored for now. It is a complex problem.

Since ErrorList extends UserList which extends collections.abc.MutableMapping.

@sobolevn sobolevn merged commit 9d92914 into typeddjango:master May 19, 2024
36 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants