mirror of
https://github.com/davidhalter/django-stubs.git
synced 2025-12-07 04:34:29 +08:00
add stubs for models.Model method
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
from typing import Any
|
from typing import Any, List, Optional, Set
|
||||||
|
|
||||||
|
|
||||||
class ModelBase(type):
|
class ModelBase(type):
|
||||||
@@ -9,8 +9,32 @@ class Model(metaclass=ModelBase):
|
|||||||
class DoesNotExist(Exception):
|
class DoesNotExist(Exception):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
pk: Any = ...
|
||||||
|
|
||||||
def __init__(self, **kwargs) -> None: ...
|
def __init__(self, **kwargs) -> None: ...
|
||||||
|
|
||||||
def delete(self,
|
def delete(self,
|
||||||
using: Any = ...,
|
using: Any = ...,
|
||||||
keep_parents: bool = ...) -> None: ...
|
keep_parents: bool = ...) -> None: ...
|
||||||
|
|
||||||
|
def full_clean(
|
||||||
|
self, exclude: Optional[List[str]] = ..., validate_unique: bool = ...
|
||||||
|
) -> None: ...
|
||||||
|
|
||||||
|
def clean_fields(self, exclude: List[str] = ...) -> None: ...
|
||||||
|
|
||||||
|
def validate_unique(self, exclude: List[str] = ...) -> None: ...
|
||||||
|
|
||||||
|
def save(
|
||||||
|
self,
|
||||||
|
force_insert: bool = ...,
|
||||||
|
force_update: bool = ...,
|
||||||
|
using: Optional[str] = ...,
|
||||||
|
update_fields: Optional[List[str]] = ...,
|
||||||
|
) -> None: ...
|
||||||
|
|
||||||
|
def refresh_from_db(
|
||||||
|
self, using: None = ..., fields: Optional[List[str]] = ...
|
||||||
|
) -> None: ...
|
||||||
|
|
||||||
|
def get_deferred_fields(self) -> Set[str]: ...
|
||||||
|
|||||||
Reference in New Issue
Block a user