From 7fe0fe1fe37e323d7b58e4df6e9f2ba78deff471 Mon Sep 17 00:00:00 2001 From: Sergei Maertens Date: Mon, 21 Oct 2024 18:52:18 +0200 Subject: [PATCH] Fixes #2413 -- update ModelAdmin.log_FOO method signatures Renamed the 'object' parameter to 'obj' to be consistent with the runtime implementation. Verified against Django 4.2 and the main branch. --- django-stubs/contrib/admin/options.pyi | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/django-stubs/contrib/admin/options.pyi b/django-stubs/contrib/admin/options.pyi index 3465886438..892b91cb36 100644 --- a/django-stubs/contrib/admin/options.pyi +++ b/django-stubs/contrib/admin/options.pyi @@ -204,9 +204,9 @@ class ModelAdmin(BaseModelAdmin[_ModelT]): orphans: int = ..., allow_empty_first_page: bool = ..., ) -> Paginator: ... - def log_addition(self, request: HttpRequest, object: _ModelT, message: Any) -> LogEntry: ... - def log_change(self, request: HttpRequest, object: _ModelT, message: Any) -> LogEntry: ... - def log_deletion(self, request: HttpRequest, object: _ModelT, object_repr: str) -> LogEntry: ... + def log_addition(self, request: HttpRequest, obj: _ModelT, message: Any) -> LogEntry: ... + def log_change(self, request: HttpRequest, obj: _ModelT, message: Any) -> LogEntry: ... + def log_deletion(self, request: HttpRequest, obj: _ModelT, object_repr: str) -> LogEntry: ... def action_checkbox(self, obj: _ModelT) -> SafeString: ... def get_actions(self, request: HttpRequest) -> dict[str, tuple[Callable[..., str], str, str] | None]: ... def get_action_choices(