mirror of
https://github.com/davidhalter/django-stubs.git
synced 2025-12-07 04:34:29 +08:00
Merge pull request #8 from K0Te/get_object_or_404-annotation
Fix get_object_or_404() klass parameter annotation.
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
from typing import Any, Callable, Dict, List, Optional, Type, Union
|
||||
|
||||
from django.db.models.base import Model
|
||||
from django.db.models.base import Model, Manager, QuerySet
|
||||
from django.http.response import HttpResponse, HttpResponseRedirect
|
||||
|
||||
from django.http import HttpRequest
|
||||
@@ -21,6 +21,6 @@ def render(
|
||||
using: Optional[str] = ...,
|
||||
) -> HttpResponse: ...
|
||||
def redirect(to: Union[Callable, str], *args: Any, permanent: bool = ..., **kwargs: Any) -> HttpResponseRedirect: ...
|
||||
def get_object_or_404(klass: Union[Type[Model], str], *args: Any, **kwargs: Any) -> Model: ...
|
||||
def get_object_or_404(klass: Union[Type[Model], Type[Manager], QuerySet], *args: Any, **kwargs: Any) -> Model: ...
|
||||
def get_list_or_404(klass: List[Type[Model]], *args: Any, **kwargs: Any) -> List[Model]: ...
|
||||
def resolve_url(to: Union[Callable, Model, str], *args: Any, **kwargs: Any) -> str: ...
|
||||
|
||||
Reference in New Issue
Block a user