Skip to content

Commit

Permalink
[5.1] Add from_queryset param to (a)refresh_from_db()
Browse files Browse the repository at this point in the history
  • Loading branch information
jacobtylerwalls committed Oct 12, 2024
1 parent 6bfd210 commit f6e1648
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 8 deletions.
14 changes: 12 additions & 2 deletions django-stubs/db/models/base.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,18 @@ class Model(metaclass=ModelBase):
using: str | None = None,
update_fields: Iterable[str] | None = None,
) -> None: ...
def refresh_from_db(self, using: str | None = None, fields: Iterable[str] | None = None) -> None: ...
async def arefresh_from_db(self, using: str | None = None, fields: Iterable[str] | None = None) -> None: ...
def refresh_from_db(
self,
using: str | None = None,
fields: Iterable[str] | None = None,
refresh_from_db: QuerySet[Self] | None = None,
) -> None: ...
async def arefresh_from_db(
self,
using: str | None = None,
fields: Iterable[str] | None = None,
refresh_from_db: QuerySet[Self] | None = None,
) -> None: ...
def serializable_value(self, field_name: str) -> Any: ...
def prepare_database_save(self, field: Field) -> Any: ...
def get_deferred_fields(self) -> set[str]: ...
Expand Down
6 changes: 0 additions & 6 deletions scripts/stubtest/allowlist_todo_django51.txt
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,7 @@ django.contrib.gis.db.models.Field.slice_expression
django.contrib.gis.db.models.ForeignObjectRel.accessor_name
django.contrib.gis.db.models.ForeignObjectRel.cache_name
django.contrib.gis.db.models.ForeignObjectRel.is_hidden
django.contrib.gis.db.models.Model.arefresh_from_db
django.contrib.gis.db.models.Model.asave
django.contrib.gis.db.models.Model.refresh_from_db
django.contrib.gis.db.models.Model.save
django.contrib.gis.db.models.OrderBy.constraint_validation_compatible
django.contrib.gis.db.models.TextField.slice_expression
Expand Down Expand Up @@ -199,18 +197,14 @@ django.db.models.Field.slice_expression
django.db.models.ForeignObjectRel.accessor_name
django.db.models.ForeignObjectRel.cache_name
django.db.models.ForeignObjectRel.is_hidden
django.db.models.Model.arefresh_from_db
django.db.models.Model.asave
django.db.models.Model.refresh_from_db
django.db.models.Model.save
django.db.models.OrderBy.constraint_validation_compatible
django.db.models.TextField.slice_expression
django.db.models.WindowFrame.__init__
django.db.models.WindowFrame.get_exclusion
django.db.models.WindowFrameExclusion
django.db.models.base.Model.arefresh_from_db
django.db.models.base.Model.asave
django.db.models.base.Model.refresh_from_db
django.db.models.base.Model.save
django.db.models.constraints.CheckConstraint.__init__
django.db.models.expressions.BaseExpression.constraint_validation_compatible
Expand Down

0 comments on commit f6e1648

Please sign in to comment.