mirror of
https://github.com/davidhalter/django-stubs.git
synced 2025-12-16 00:37:11 +08:00
expressions
This commit is contained in:
@@ -32,6 +32,8 @@ from django.db.models.fields.reverse_related import (
|
||||
)
|
||||
from django.db.models.query_utils import PathInfo, Q
|
||||
|
||||
from django.db.models.expressions import F
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from django.db.models.manager import RelatedManager
|
||||
|
||||
@@ -102,6 +104,7 @@ class ForeignObject(RelatedField):
|
||||
|
||||
class ForeignKey(RelatedField, Generic[_T]):
|
||||
def __init__(self, to: Union[Type[_T], str], on_delete: Any, related_name: str = ..., **kwargs): ...
|
||||
def __set__(self, instance, value: Union[Model, F]) -> None: ...
|
||||
def __get__(self, instance, owner) -> _T: ...
|
||||
|
||||
class OneToOneField(RelatedField, Generic[_T]):
|
||||
|
||||
Reference in New Issue
Block a user