Skip to content

Commit

Permalink
Added Model._do_update() method signature (#1854)
Browse files Browse the repository at this point in the history
Add typing for a private method (used in django-fsm), which signature has not changed since 2013.

Co-authored-by: Marti Raudsepp <[email protected]>
  • Loading branch information
pfouque and intgr authored Dec 5, 2023
1 parent 9720b27 commit fb0908a
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion django-stubs/db/models/base.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ from typing import Any, ClassVar, Final, TypeVar, overload
from django.core.checks.messages import CheckMessage
from django.core.exceptions import MultipleObjectsReturned as BaseMultipleObjectsReturned
from django.core.exceptions import ObjectDoesNotExist, ValidationError
from django.db.models import BaseConstraint, Field
from django.db.models import BaseConstraint, Field, QuerySet
from django.db.models.manager import BaseManager, Manager
from django.db.models.options import Options
from typing_extensions import Self
Expand Down Expand Up @@ -49,6 +49,15 @@ class Model(metaclass=ModelBase):
def add_to_class(cls, name: str, value: Any) -> Any: ...
@classmethod
def from_db(cls, db: str | None, field_names: Collection[str], values: Collection[Any]) -> Self: ...
def _do_update(
self,
base_qs: QuerySet[Self],
using: str | None,
pk_val: Any,
values: Collection[tuple[Field, type[Model] | None, Any]],
update_fields: Iterable[str] | None,
forced_update: bool,
) -> bool: ...
def delete(self, using: Any = ..., keep_parents: bool = ...) -> tuple[int, dict[str, int]]: ...
async def adelete(self, using: Any = ..., keep_parents: bool = ...) -> tuple[int, dict[str, int]]: ...
def full_clean(
Expand Down

0 comments on commit fb0908a

Please sign in to comment.