mirror of
https://github.com/davidhalter/django-stubs.git
synced 2025-12-15 16:27:09 +08:00
allow to use fields as Field objects outside Model classes
This commit is contained in:
@@ -90,9 +90,12 @@ class Field(RegisterLookupMixin, Generic[_ST, _GT]):
|
||||
# class access
|
||||
@overload
|
||||
def __get__(self: _T, instance: None, owner) -> _T: ...
|
||||
# instance access
|
||||
# Model instance access
|
||||
@overload
|
||||
def __get__(self, instance, owner) -> _GT: ...
|
||||
def __get__(self, instance: Model, owner) -> _GT: ...
|
||||
# non-Model instances
|
||||
@overload
|
||||
def __get__(self: _T, instance, owner) -> _T: ...
|
||||
def deconstruct(self) -> Any: ...
|
||||
def set_attributes_from_name(self, name: str) -> None: ...
|
||||
def db_type(self, connection: Any) -> str: ...
|
||||
|
||||
Reference in New Issue
Block a user