mirror of
https://github.com/davidhalter/django-stubs.git
synced 2025-12-06 12:14:28 +08:00
Add db.models.fields.Field method stubs for custom Fields (#331)
Add stubs for: pre_save, get_db_prep_value, get_db_prep_save
This commit is contained in:
@@ -108,7 +108,10 @@ class Field(RegisterLookupMixin, Generic[_ST, _GT]):
|
|||||||
def set_attributes_from_name(self, name: str) -> None: ...
|
def set_attributes_from_name(self, name: str) -> None: ...
|
||||||
def db_type(self, connection: Any) -> str: ...
|
def db_type(self, connection: Any) -> str: ...
|
||||||
def db_parameters(self, connection: Any) -> Dict[str, str]: ...
|
def db_parameters(self, connection: Any) -> Dict[str, str]: ...
|
||||||
|
def pre_save(self, model_instance: Model, add: bool) -> Any: ...
|
||||||
def get_prep_value(self, value: Any) -> Any: ...
|
def get_prep_value(self, value: Any) -> Any: ...
|
||||||
|
def get_db_prep_value(self, value: Any, connection: Any, prepared: bool) -> Any: ...
|
||||||
|
def get_db_prep_save(self, value: Any, connection: Any) -> Any: ...
|
||||||
def get_internal_type(self) -> str: ...
|
def get_internal_type(self) -> str: ...
|
||||||
# TODO: plugin support
|
# TODO: plugin support
|
||||||
def formfield(self, **kwargs) -> Any: ...
|
def formfield(self, **kwargs) -> Any: ...
|
||||||
|
|||||||
Reference in New Issue
Block a user