From 5a1dc5c4708ecab8a8502071405645ae2b3a6650 Mon Sep 17 00:00:00 2001 From: Serhii Tereshchenko Date: Tue, 26 Dec 2023 14:53:47 +0200 Subject: [PATCH] fix: Add `get_inlines` method to BaseModelAdmin --- django-stubs/contrib/admin/options.pyi | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/django-stubs/contrib/admin/options.pyi b/django-stubs/contrib/admin/options.pyi index 9832bf101..193ca1ea9 100644 --- a/django-stubs/contrib/admin/options.pyi +++ b/django-stubs/contrib/admin/options.pyi @@ -1,6 +1,6 @@ from collections import OrderedDict from collections.abc import Callable, Iterator, Mapping, Sequence -from typing import Any, Generic, TypeVar +from typing import Any, Generic, Iterable, TypeVar from typing_extensions import Literal, TypedDict from django.contrib.admin.filters import ListFilter @@ -126,6 +126,9 @@ class BaseModelAdmin(Generic[_ModelT]): def get_sortable_by( self, request: HttpRequest ) -> list[Callable[..., Any]] | list[str] | tuple[Any, ...]: ... + def get_inlines( + self, request: HttpRequest, obj: _ModelT | None + ) -> Iterable[type[InlineModelAdmin[Any]]]: ... def lookup_allowed(self, lookup: str, value: str) -> bool: ... def to_field_allowed(self, request: HttpRequest, to_field: str) -> bool: ... def has_add_permission(self, request: HttpRequest) -> bool: ...