diff --git a/django-stubs/contrib/admin/models.pyi b/django-stubs/contrib/admin/models.pyi index ddaf571de..f2fb0d520 100644 --- a/django-stubs/contrib/admin/models.pyi +++ b/django-stubs/contrib/admin/models.pyi @@ -1,7 +1,8 @@ -from typing import Any, ClassVar +from typing import Any, ClassVar, Literal, overload from uuid import UUID from django.db import models +from django.db.models import QuerySet from django.db.models.base import Model from typing_extensions import deprecated @@ -21,6 +22,26 @@ class LogEntryManager(models.Manager[LogEntry]): action_flag: int, change_message: Any = ..., ) -> LogEntry: ... + @overload + def log_actions( + self, + user_id: int, + queryset: QuerySet[Model], + action_flag: int, + change_message: str | list[Any] = "", + *, + single_object: Literal[True], + ) -> LogEntry: ... + @overload + def log_actions( + self, + user_id: int, + queryset: QuerySet[Model], + action_flag: int, + change_message: str | list[Any] = "", + *, + single_object: Literal[False] = False, + ) -> list[LogEntry]: ... class LogEntry(models.Model): action_time: models.DateTimeField diff --git a/scripts/stubtest/allowlist_todo_django51.txt b/scripts/stubtest/allowlist_todo_django51.txt index acf99ff42..595cac4ab 100644 --- a/scripts/stubtest/allowlist_todo_django51.txt +++ b/scripts/stubtest/allowlist_todo_django51.txt @@ -5,7 +5,6 @@ django.contrib.admin.helpers.Fieldset.is_collapsible django.contrib.admin.helpers.InlineAdminFormSet.is_collapsible -django.contrib.admin.models.LogEntryManager.log_actions django.contrib.auth.base_user.BaseUserManager.make_random_password django.contrib.auth.checks.check_middleware django.contrib.auth.forms.AdminPasswordChangeForm.clean_password2