Код: Выделить всё
_GTКод: Выделить всё
from django.db.models import ForeignKey, PROTECT
order = ForeignKey["ExtensionOrder", _GT](
"subscriptions.ExtensionOrder",
null=False,
on_delete=PROTECT
)
Код: Выделить всё
class ForeignKey(ForeignObject[_ST, _GT]):
_pyi_private_set_type: Union[Any, Combinable]
_pyi_private_get_type: Any
...
# class access
@overload # type: ignore
def __get__(self, instance: None, owner) -> ForwardManyToOneDescriptor: ...
# Model instance access
@overload
def __get__(self, instance: Model, owner) -> **_GT**: ...
# non-Model instances
@overload
def __get__(self: _F, instance, owner) -> _F: ...
Код: Выделить всё
_GTПодробнее здесь: https://stackoverflow.com/questions/752 ... -typehints