Skip to content

Commit

Permalink
Fix ManyToManyRawIdWidget to accept ManyToManyRel argument (#1447)
Browse files Browse the repository at this point in the history
  • Loading branch information
RyanWalker277 authored Apr 29, 2023
1 parent c7e3ea2 commit 01bf258
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion django-stubs/contrib/admin/widgets.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,11 @@ class ForeignKeyRawIdWidget(forms.TextInput):
admin_site: AdminSite
db: str | None
def __init__(
self, rel: ManyToOneRel, admin_site: AdminSite, attrs: _OptAttrs | None = ..., using: str | None = ...
self,
rel: ManyToOneRel,
admin_site: AdminSite,
attrs: _OptAttrs | None = ...,
using: str | None = ...,
) -> None: ...
def base_url_parameters(self) -> dict[str, str]: ...
def get_context(self, name: str, value: Any, attrs: _OptAttrs | None) -> dict[str, Any]: ...
Expand All @@ -51,6 +55,13 @@ class ForeignKeyRawIdWidget(forms.TextInput):

class ManyToManyRawIdWidget(ForeignKeyRawIdWidget):
rel: ManyToManyRel # type: ignore
def __init__(
self,
rel: ManyToManyRel,
admin_site: AdminSite,
attrs: _OptAttrs | None = ...,
using: str | None = ...,
) -> None: ...
def get_context(self, name: str, value: Any, attrs: _OptAttrs | None) -> dict[str, Any]: ...
def url_parameters(self) -> dict[str, str]: ...
def label_and_url_for_value(self, value: Any) -> tuple[str, str]: ...
Expand Down

0 comments on commit 01bf258

Please sign in to comment.