mirror of
https://github.com/davidhalter/django-stubs.git
synced 2026-11-05 20:03:00 +08:00
* Replace models.Model annotations with type variables * Adds generic type args to generic views * Adds more tests * Revert "Adds generic type args to generic views" This reverts commit 6522f30cdb9027483f46d77167394c84eb7b7f4b. * Adds Generic support for DetailView and ListView Co-authored-by: sobolevn <mail@sobolevn.me>
13 lines
378 B
Python
13 lines
378 B
Python
from typing import Callable, Optional, TypeVar, overload
|
|
|
|
_C = TypeVar("_C", bound=Callable)
|
|
|
|
@overload
|
|
def staff_member_required(
|
|
view_func: _C = ..., redirect_field_name: Optional[str] = ..., login_url: str = ...
|
|
) -> _C: ...
|
|
@overload
|
|
def staff_member_required(
|
|
view_func: None = ..., redirect_field_name: Optional[str] = ..., login_url: str = ...
|
|
) -> Callable: ...
|