Fixed #33680 -- Corrected example of customizing model loading in docs.

This commit is contained in:
Ali Toosi 2022-05-05 19:32:07 +10:00 committed by Mariusz Felisiak
parent ec5659382a
commit faab9e6769
1 changed files with 3 additions and 1 deletions

View File

@ -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):