mirror of
https://github.com/davidhalter/django-stubs.git
synced 2025-12-15 16:27:09 +08:00
Improve types for QuerySet.contains and bulk_create (#1134)
* Improve types for QuerySet.contains and bulk_create * models.Model
This commit is contained in:
@@ -63,10 +63,22 @@ class _QuerySet(Generic[_T, _Row], Collection[_Row], Reversible[_Row], Sized):
|
||||
def create(self, **kwargs: Any) -> _T: ...
|
||||
async def acreate(self, **kwargs: Any) -> _T: ...
|
||||
def bulk_create(
|
||||
self, objs: Iterable[_T], batch_size: Optional[int] = ..., ignore_conflicts: bool = ...
|
||||
self,
|
||||
objs: Iterable[_T],
|
||||
batch_size: Optional[int] = ...,
|
||||
ignore_conflicts: bool = ...,
|
||||
update_conflicts: bool = ...,
|
||||
update_fields: Optional[Collection[str]] = ...,
|
||||
unique_fields: Optional[Collection[str]] = ...,
|
||||
) -> List[_T]: ...
|
||||
async def abulk_create(
|
||||
self, objs: Iterable[_T], batch_size: Optional[int] = ..., ignore_conflicts: bool = ...
|
||||
self,
|
||||
objs: Iterable[_T],
|
||||
batch_size: Optional[int] = ...,
|
||||
ignore_conflicts: bool = ...,
|
||||
update_conflicts: bool = ...,
|
||||
update_fields: Optional[Collection[str]] = ...,
|
||||
unique_fields: Optional[Collection[str]] = ...,
|
||||
) -> List[_T]: ...
|
||||
def bulk_update(self, objs: Iterable[_T], fields: Iterable[str], batch_size: Optional[int] = ...) -> int: ...
|
||||
async def abulk_update(self, objs: Iterable[_T], fields: Iterable[str], batch_size: Optional[int] = ...) -> int: ...
|
||||
@@ -98,8 +110,8 @@ class _QuerySet(Generic[_T, _Row], Collection[_Row], Reversible[_Row], Sized):
|
||||
async def aexists(self) -> bool: ...
|
||||
def explain(self, *, format: Optional[Any] = ..., **options: Any) -> str: ...
|
||||
async def aexplain(self, *, format: Optional[Any] = ..., **options: Any) -> str: ...
|
||||
def contains(self, objs: Iterable[_T]) -> bool: ...
|
||||
async def acontains(self, objs: Iterable[_T]) -> bool: ...
|
||||
def contains(self, obj: models.Model) -> bool: ...
|
||||
async def acontains(self, obj: models.Model) -> bool: ...
|
||||
def raw(
|
||||
self,
|
||||
raw_query: str,
|
||||
|
||||
Reference in New Issue
Block a user