Skip to content

Commit

Permalink
Fix get_deleted_objects() return type from list[Model] -> `list[s…
Browse files Browse the repository at this point in the history
…tr]` (#1825)

* Updates `admin.ModelAdmin.get_deleted_objects()`
* Updates `admin.utils.get_deleted_objects()`
  • Loading branch information
golgor authored Nov 7, 2023
1 parent 5bab9ae commit 7440a7e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion django-stubs/contrib/admin/options.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ class ModelAdmin(BaseModelAdmin[_ModelT]):
def changelist_view(self, request: HttpRequest, extra_context: dict[str, Any] | None = ...) -> HttpResponse: ...
def get_deleted_objects(
self, objs: Sequence[_ModelT] | QuerySet[_ModelT], request: HttpRequest
) -> tuple[list[Model], dict[str, int], set[str], list[str]]: ...
) -> tuple[list[str], dict[str, int], set[str], list[str]]: ...
def delete_view(
self, request: HttpRequest, object_id: str, extra_context: dict[str, Any] | None = ...
) -> HttpResponse: ...
Expand Down
2 changes: 1 addition & 1 deletion django-stubs/contrib/admin/utils.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def flatten(fields: Any) -> list[Callable | str]: ...
def flatten_fieldsets(fieldsets: Any) -> list[Callable | str]: ...
def get_deleted_objects(
objs: Sequence[Model | None] | QuerySet[Model], request: HttpRequest, admin_site: AdminSite
) -> tuple[list[Model], dict[str, int], set[str], list[str]]: ...
) -> tuple[list[str], dict[str, int], set[str], list[str]]: ...

class NestedObjects(Collector):
data: dict[type[Model], set[Model] | list[Model]]
Expand Down

0 comments on commit 7440a7e

Please sign in to comment.