Skip to content

Commit fb0908a

Browse files
pfouqueintgr
andauthored
Added Model._do_update() method signature (#1854)
Add typing for a private method (used in django-fsm), which signature has not changed since 2013. Co-authored-by: Marti Raudsepp <[email protected]>
1 parent 9720b27 commit fb0908a

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

django-stubs/db/models/base.pyi

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ from typing import Any, ClassVar, Final, TypeVar, overload
44
from django.core.checks.messages import CheckMessage
55
from django.core.exceptions import MultipleObjectsReturned as BaseMultipleObjectsReturned
66
from django.core.exceptions import ObjectDoesNotExist, ValidationError
7-
from django.db.models import BaseConstraint, Field
7+
from django.db.models import BaseConstraint, Field, QuerySet
88
from django.db.models.manager import BaseManager, Manager
99
from django.db.models.options import Options
1010
from typing_extensions import Self
@@ -49,6 +49,15 @@ class Model(metaclass=ModelBase):
4949
def add_to_class(cls, name: str, value: Any) -> Any: ...
5050
@classmethod
5151
def from_db(cls, db: str | None, field_names: Collection[str], values: Collection[Any]) -> Self: ...
52+
def _do_update(
53+
self,
54+
base_qs: QuerySet[Self],
55+
using: str | None,
56+
pk_val: Any,
57+
values: Collection[tuple[Field, type[Model] | None, Any]],
58+
update_fields: Iterable[str] | None,
59+
forced_update: bool,
60+
) -> bool: ...
5261
def delete(self, using: Any = ..., keep_parents: bool = ...) -> tuple[int, dict[str, int]]: ...
5362
async def adelete(self, using: Any = ..., keep_parents: bool = ...) -> tuple[int, dict[str, int]]: ...
5463
def full_clean(

0 commit comments

Comments
 (0)