mirror of https://github.com/django/django.git
Fixed #33680 -- Corrected example of customizing model loading in docs.
This commit is contained in:
parent
ec5659382a
commit
faab9e6769
|
@ -103,7 +103,9 @@ are loaded from the database::
|
|||
instance._state.adding = False
|
||||
instance._state.db = db
|
||||
# customization to store the original field values on the instance
|
||||
instance._loaded_values = dict(zip(field_names, values))
|
||||
instance._loaded_values = dict(
|
||||
zip(field_names, (value for value in values if value is not DEFERRED))
|
||||
)
|
||||
return instance
|
||||
|
||||
def save(self, *args, **kwargs):
|
||||
|
|
Loading…
Reference in New Issue