From 16df9cb6cc6188a53de32bbdcbb25fba54d83aa5 Mon Sep 17 00:00:00 2001
From: Lachlan Musicman <datakid@gmail.com>
Date: Fri, 2 Jun 2017 11:08:05 +1000
Subject: [PATCH] Update from_db in instance.txt
The from_db example didn't work - creating a new instance called new, then referring to instance. Needed to be one or the other.
---
docs/ref/models/instances.txt | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/docs/ref/models/instances.txt b/docs/ref/models/instances.txt
index 3077a22ef23..ae560a6a72e 100644
a
|
b
|
are loaded from the database::
|
99 | 99 | values.pop() if f.attname in field_names else DEFERRED |
100 | 100 | for f in cls._meta.concrete_fields |
101 | 101 | ] |
102 | | new = cls(*values) |
| 102 | instance = cls(*values) |
103 | 103 | instance._state.adding = False |
104 | 104 | instance._state.db = db |
105 | 105 | # customization to store the original field values on the instance |