Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added Model._do_update() method signature #1854

Merged
merged 2 commits into from
Dec 5, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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