From 362342d998c6ac119127bd239400889f3050f20c Mon Sep 17 00:00:00 2001 From: Alexander Viklund Date: Wed, 9 Dec 2020 17:12:54 +0100 Subject: [PATCH] Make queryset parameter to ModelMultipleChoiceField Optional --- django-stubs/forms/models.pyi | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/django-stubs/forms/models.pyi b/django-stubs/forms/models.pyi index 549db20..1cb275f 100644 --- a/django-stubs/forms/models.pyi +++ b/django-stubs/forms/models.pyi @@ -255,7 +255,7 @@ class ModelChoiceField(ChoiceField): to_field_name: None = ... def __init__( self, - queryset: Optional[Union[Manager, QuerySet]], + queryset: Optional[Union[Manager, _BaseQuerySet]], *, empty_label: Optional[str] = ..., required: bool = ..., @@ -282,7 +282,7 @@ class ModelMultipleChoiceField(ModelChoiceField): widget: Any = ... hidden_widget: Any = ... default_error_messages: Any = ... - def __init__(self, queryset: _BaseQuerySet, **kwargs: Any) -> None: ... + def __init__(self, queryset: Optional[Union[Manager, _BaseQuerySet]], **kwargs: Any) -> None: ... def _get_foreign_key( parent_model: Type[Model], model: Type[Model], fk_name: Optional[str] = ..., can_fail: bool = ...