From 786f735b5ca44f352096376243412b3a44c6060b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=82=AC=EC=9E=AC=ED=98=81?= Date: Sat, 7 Dec 2024 04:36:11 +0900 Subject: [PATCH] Update django.contrib.admin.options.ModelAdmin (#2422) Signed-off-by: SaJH --- django-stubs/contrib/admin/options.pyi | 1 + scripts/stubtest/allowlist_todo_django51.txt | 3 --- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/django-stubs/contrib/admin/options.pyi b/django-stubs/contrib/admin/options.pyi index 746a2af87..02e172dc0 100644 --- a/django-stubs/contrib/admin/options.pyi +++ b/django-stubs/contrib/admin/options.pyi @@ -208,6 +208,7 @@ class ModelAdmin(BaseModelAdmin[_ModelT]): def log_change(self, request: HttpRequest, obj: _ModelT, message: Any) -> LogEntry: ... @deprecated("log_deletion() is deprecated and will be removed in Django 6.0. Use log_deletions() instead.") def log_deletion(self, request: HttpRequest, obj: _ModelT, object_repr: str) -> LogEntry: ... + def log_deletions(self, request: HttpRequest, queryset: QuerySet[_ModelT]) -> list[LogEntry] | 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( diff --git a/scripts/stubtest/allowlist_todo_django51.txt b/scripts/stubtest/allowlist_todo_django51.txt index 306f38c52..665574ff8 100644 --- a/scripts/stubtest/allowlist_todo_django51.txt +++ b/scripts/stubtest/allowlist_todo_django51.txt @@ -3,11 +3,9 @@ # Only discrepancies that appeared after Django 5.0 -> 5.1 update. # Unsorted: there are real problems and things we can really ignore: -django.contrib.admin.ModelAdmin.log_deletions django.contrib.admin.helpers.Fieldset.is_collapsible django.contrib.admin.helpers.InlineAdminFormSet.is_collapsible django.contrib.admin.models.LogEntryManager.log_actions -django.contrib.admin.options.ModelAdmin.log_deletions django.contrib.auth.base_user.BaseUserManager.make_random_password django.contrib.auth.checks.check_middleware django.contrib.auth.forms.AdminPasswordChangeForm.clean_password2 @@ -25,7 +23,6 @@ django.contrib.auth.models.BaseUserManager.make_random_password django.contrib.contenttypes.fields.GenericForeignKey.cache_name django.contrib.contenttypes.fields.GenericForeignKey.get_attname_column django.contrib.contenttypes.models.ContentType.get_object_for_this_type -django.contrib.gis.admin.ModelAdmin.log_deletions django.contrib.gis.db.backends.mysql.operations.MySQLOperations.collect django.contrib.gis.db.models.CharField.slice_expression django.contrib.gis.db.models.CheckConstraint.__init__