mirror of
https://github.com/davidhalter/django-stubs.git
synced 2025-12-10 14:01:56 +08:00
Improve admin filter types (#984)
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
from typing import Any, Callable, Dict, Iterator, List, Optional, Tuple, Type
|
||||
from typing import Any, Callable, Dict, Iterable, Iterator, List, Optional, Tuple, Type
|
||||
|
||||
from django.contrib.admin.options import ModelAdmin
|
||||
from django.db.models.base import Model
|
||||
@@ -16,14 +16,14 @@ class ListFilter:
|
||||
) -> None: ...
|
||||
def has_output(self) -> bool: ...
|
||||
def choices(self, changelist: Any) -> Iterator[Dict[str, Any]]: ...
|
||||
def queryset(self, request: Any, queryset: QuerySet) -> Optional[QuerySet]: ...
|
||||
def queryset(self, request: HttpRequest, queryset: QuerySet) -> Optional[QuerySet]: ...
|
||||
def expected_parameters(self) -> Optional[List[str]]: ...
|
||||
|
||||
class SimpleListFilter(ListFilter):
|
||||
parameter_name: str = ...
|
||||
lookup_choices: Any = ...
|
||||
def value(self) -> Optional[str]: ...
|
||||
def lookups(self, request: Any, model_admin: Any) -> List[Tuple[Any, str]]: ...
|
||||
def lookups(self, request: HttpRequest, model_admin: ModelAdmin) -> Iterable[Tuple[Any, str]]: ...
|
||||
def choices(self, changelist: Any) -> Iterator[Dict[str, Any]]: ...
|
||||
|
||||
class FieldListFilter(ListFilter):
|
||||
|
||||
Reference in New Issue
Block a user