MCPcopy
hub / github.com/django/django / refresh_from_db

Method refresh_from_db

tests/defer/models.py:47–54  ·  view source on GitHub ↗
(self, using=None, fields=None, **kwargs)

Source from the content-addressed store, hash-verified

45 proxy = True
46
47 def refresh_from_db(self, using=None, fields=None, **kwargs):
48 # Reloads all deferred fields if any of the fields is deferred.
49 if fields is not None:
50 fields = set(fields)
51 deferred_fields = self.get_deferred_fields()
52 if fields.intersection(deferred_fields):
53 fields = fields.union(deferred_fields)
54 super().refresh_from_db(using, fields, **kwargs)
55
56
57class ShadowParent(models.Model):

Callers 15

test_uuid4Method · 0.45
test_uuid7Method · 0.45
test_updateMethod · 0.45
test_updateMethod · 0.45
test_basicMethod · 0.45
test_filefield_writeMethod · 0.45
test_refreshMethod · 0.45

Calls 3

get_deferred_fieldsMethod · 0.80
intersectionMethod · 0.45
unionMethod · 0.45

Tested by 15

test_uuid4Method · 0.36
test_uuid7Method · 0.36
test_updateMethod · 0.36
test_updateMethod · 0.36
test_basicMethod · 0.36
test_filefield_writeMethod · 0.36
test_refreshMethod · 0.36