mirror of
https://github.com/davidhalter/django-stubs.git
synced 2025-12-10 14:01:56 +08:00
Fix QuerySet.create and Manager.create annotation since it doesn't accept *args (only **kwargs) (#762)
This commit is contained in:
@@ -47,7 +47,7 @@ class BaseManager(Generic[_T]):
|
||||
def iterator(self, chunk_size: int = ...) -> Iterator[_T]: ...
|
||||
def aggregate(self, *args: Any, **kwargs: Any) -> Dict[str, Any]: ...
|
||||
def get(self, *args: Any, **kwargs: Any) -> _T: ...
|
||||
def create(self, *args: Any, **kwargs: Any) -> _T: ...
|
||||
def create(self, **kwargs: Any) -> _T: ...
|
||||
def bulk_create(
|
||||
self, objs: Iterable[_T], batch_size: Optional[int] = ..., ignore_conflicts: bool = ...
|
||||
) -> List[_T]: ...
|
||||
|
||||
@@ -55,7 +55,7 @@ class _QuerySet(Generic[_T, _Row], Collection[_Row], Reversible[_Row], Sized):
|
||||
def iterator(self, chunk_size: int = ...) -> Iterator[_Row]: ...
|
||||
def aggregate(self, *args: Any, **kwargs: Any) -> Dict[str, Any]: ...
|
||||
def get(self, *args: Any, **kwargs: Any) -> _Row: ...
|
||||
def create(self, *args: Any, **kwargs: Any) -> _T: ...
|
||||
def create(self, **kwargs: Any) -> _T: ...
|
||||
def bulk_create(
|
||||
self, objs: Iterable[_T], batch_size: Optional[int] = ..., ignore_conflicts: bool = ...
|
||||
) -> List[_T]: ...
|
||||
|
||||
@@ -371,8 +371,8 @@
|
||||
from django.db import models
|
||||
class MyModelManager(models.Manager):
|
||||
|
||||
def create(self, *args, **kwargs) -> 'MyModel':
|
||||
return super().create(*args, **kwargs)
|
||||
def create(self, **kwargs) -> 'MyModel':
|
||||
return super().create(**kwargs)
|
||||
|
||||
|
||||
class MyModel(models.Model):
|
||||
@@ -392,8 +392,8 @@
|
||||
from django.db import models
|
||||
class MyModelManager(models.Manager['MyModel']):
|
||||
|
||||
def create(self, *args, **kwargs) -> 'MyModel':
|
||||
return super().create(*args, **kwargs)
|
||||
def create(self, **kwargs) -> 'MyModel':
|
||||
return super().create(**kwargs)
|
||||
|
||||
class MyModel(models.Model):
|
||||
|
||||
|
||||
Reference in New Issue
Block a user