mirror of
https://github.com/davidhalter/django-stubs.git
synced 2025-12-18 01:45:59 +08:00
add ForeignKey
This commit is contained in:
14
django-stubs/db/models/fields/related.pyi
Normal file
14
django-stubs/db/models/fields/related.pyi
Normal file
@@ -0,0 +1,14 @@
|
||||
from typing import Type, Union, TypeVar, Any, Generic
|
||||
|
||||
from django.db import models
|
||||
from django.db.models import Field
|
||||
|
||||
_T = TypeVar('_T', bound=models.Model)
|
||||
|
||||
|
||||
class ForeignKey(Field, Generic[_T]):
|
||||
def __init__(self,
|
||||
to: Union[Type[_T], str],
|
||||
on_delete: Any,
|
||||
**kwargs): ...
|
||||
def __get__(self, instance, owner) -> _T: ...
|
||||
Reference in New Issue
Block a user