Skip to content
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

Fix get_deleted_objects() return type from list[Model] -> list[str] #1825

Merged
merged 2 commits into from
Nov 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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]]: ...
Copy link
Collaborator

Choose a reason for hiding this comment

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

Thanks! Looks like the related get_deleted_objects function in contrib/admin/utils.pyi should be updated too.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed in c99d322

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