Skip to content

Commit 3e89b53

Browse files
committed
fix: correct BaseFormSet type hints
1 parent add205d commit 3e89b53

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/polymorphic/contrib/extra_views.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ class PolymorphicFormSetMixin:
3232
Internal Mixin, that provides polymorphic integration with the ``extra_views`` package.
3333
"""
3434

35-
formset_class: type[BaseFormSet[Any]] = BasePolymorphicModelFormSet
35+
formset_class: type[BaseFormSet] = BasePolymorphicModelFormSet
3636

3737
#: Default 0 extra forms
3838
factory_kwargs: dict[str, Any] = {"extra": 0}
@@ -54,7 +54,7 @@ def get_formset_children(self) -> list[PolymorphicFormSetChild]:
5454
def get_formset_child_kwargs(self) -> dict[str, Any]:
5555
return {}
5656

57-
def get_formset(self) -> type[BaseFormSet[Any]]:
57+
def get_formset(self) -> type[BaseFormSet]:
5858
"""
5959
Returns the formset class from the inline formset factory
6060
"""
@@ -66,7 +66,7 @@ def get_formset(self) -> type[BaseFormSet[Any]]:
6666
FormSet.child_forms = polymorphic_child_forms_factory(
6767
self.get_formset_children(), **self.get_formset_child_kwargs()
6868
)
69-
return cast(type[BaseFormSet[Any]], FormSet)
69+
return cast(type[BaseFormSet], FormSet)
7070

7171

7272
class PolymorphicFormSetView(PolymorphicFormSetMixin, extra_views.ModelFormSetView):

src/polymorphic/templatetags/polymorphic_formset_tags.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@
7474

7575

7676
@register.filter()
77-
def include_empty_form(formset: BaseFormSet[Any]) -> Generator[BaseForm, None, None]:
77+
def include_empty_form(formset: BaseFormSet) -> Generator[BaseForm, None, None]:
7878
"""
7979
.. templatetag:: include_empty_form
8080

0 commit comments

Comments
 (0)