From 8a30376fbf6f7c2bf19f0072acaa245792f5dc6a Mon Sep 17 00:00:00 2001 From: q0w <43147888+q0w@users.noreply.github.com> Date: Sun, 25 Feb 2024 00:13:29 +0300 Subject: [PATCH] Add AdminSite.get_log_entries (#1963) Co-authored-by: Nikita Sobolev --- django-stubs/contrib/admin/sites.pyi | 2 ++ scripts/stubtest/allowlist_todo_django50.txt | 3 --- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/django-stubs/contrib/admin/sites.pyi b/django-stubs/contrib/admin/sites.pyi index b4138e99b..aaede7e1f 100644 --- a/django-stubs/contrib/admin/sites.pyi +++ b/django-stubs/contrib/admin/sites.pyi @@ -3,6 +3,7 @@ from collections.abc import Callable, Iterable from typing import Any, TypeVar from django.apps.config import AppConfig +from django.contrib.admin.models import LogEntry from django.contrib.admin.options import ModelAdmin from django.contrib.auth.forms import AuthenticationForm from django.core.checks import CheckMessage @@ -86,6 +87,7 @@ class AdminSite: ) -> TemplateResponse: ... def autocomplete_view(self, request: HttpRequest) -> HttpResponse: ... def catch_all_view(self, request: HttpRequest, url: str) -> HttpResponse: ... + def get_log_entries(self, request: HttpRequest) -> QuerySet[LogEntry]: ... class DefaultAdminSite(LazyObject): ... diff --git a/scripts/stubtest/allowlist_todo_django50.txt b/scripts/stubtest/allowlist_todo_django50.txt index 22fc052d5..c2cffbe20 100644 --- a/scripts/stubtest/allowlist_todo_django50.txt +++ b/scripts/stubtest/allowlist_todo_django50.txt @@ -7,7 +7,6 @@ django.conf.global_settings.CSRF_COOKIE_MASKED django.conf.global_settings.FORMS_URLFIELD_ASSUME_HTTPS django.conf.global_settings.USE_DEPRECATED_PYTZ django.conf.global_settings.USE_L10N -django.contrib.admin.AdminSite.get_log_entries django.contrib.admin.AdminSite.get_model_admin django.contrib.admin.AllValuesFieldListFilter.get_facet_counts django.contrib.admin.BooleanFieldListFilter.get_facet_counts @@ -32,7 +31,6 @@ django.contrib.admin.filters.SimpleListFilter.get_facet_counts django.contrib.admin.helpers.checkbox django.contrib.admin.options.BaseModelAdmin.lookup_allowed django.contrib.admin.options.IS_FACETS_VAR -django.contrib.admin.sites.AdminSite.get_log_entries django.contrib.admin.sites.AdminSite.get_model_admin django.contrib.admin.utils.build_q_object_from_lookup_parameters django.contrib.admin.utils.get_last_value_from_parameters @@ -43,7 +41,6 @@ django.contrib.auth.hashers.verify_password django.contrib.contenttypes.fields.GenericForeignKey.get_content_type django.contrib.contenttypes.fields.GenericForeignKey.get_prefetch_querysets django.contrib.contenttypes.prefetch -django.contrib.gis.admin.AdminSite.get_log_entries django.contrib.gis.admin.AdminSite.get_model_admin django.contrib.gis.admin.OpenLayersWidget django.contrib.gis.admin.options.spherical_mercator_srid