Skip to content

forms/formsets: Improve types #271

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

Merged
merged 1 commit into from
Oct 23, 2024
Merged

Conversation

noelleleigh
Copy link

  • Adds more specific types to all code in django-stubs/forms/formsets.pyi.
  • Removes unnecessary assignments from module and class properties.
  • BaseFormSet is now a generic class which contains a form type.

- Adds more specific types to all code in `django-stubs/forms/formsets.pyi`
- Removes unnecessary assignments from module and class properties
Copy link
Owner

@sbdchd sbdchd left a comment

Choose a reason for hiding this comment

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

Thanks!

@kodiakhq kodiakhq bot merged commit 0570ee8 into sbdchd:main Oct 23, 2024
2 checks passed
@noelleleigh noelleleigh deleted the improve-formsets branch October 23, 2024 02:04
@collinanderson
Copy link

  • formset_factory should accept type[BaseForm] not BaseForm.
  • BaseFormSet's data should also accept a Mapping[str, Any] like BaseForm, so it works with request.POST.
  • BaseFormSet's initial should take in a list of dicts, not a plain dict like BaseForm

@noelleleigh
Copy link
Author

  • formset_factory should accept type[BaseForm] not BaseForm.
  • BaseFormSet's data should also accept a Mapping[str, Any] like BaseForm, so it works with request.POST.
  • BaseFormSet's initial should take in a list of dicts, not a plain dict like BaseForm

Feel free to make a PR for these.

collinanderson added a commit to collinanderson/django-types that referenced this pull request Mar 24, 2025
@collinanderson
Copy link

ok PR here #288

kodiakhq bot pushed a commit that referenced this pull request Mar 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants