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

Update contrib.admin.models.LogEntryManager #2423

Merged
merged 4 commits into from
Dec 7, 2024
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
23 changes: 22 additions & 1 deletion django-stubs/contrib/admin/models.pyi
Original file line number Diff line number Diff line change
@@ -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

Expand All @@ -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
Expand Down
1 change: 0 additions & 1 deletion scripts/stubtest/allowlist_todo_django51.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading