| 1232 | elif context.populate_existing or mapper.always_refresh: |
| 1233 | |
| 1234 | def reset_for_lazy_callable(state, dict_, row): |
| 1235 | # we are the primary manager for this attribute on |
| 1236 | # this class - reset its |
| 1237 | # per-instance attribute state, so that the class-level |
| 1238 | # lazy loader is |
| 1239 | # executed when next referenced on this instance. |
| 1240 | # this is needed in |
| 1241 | # populate_existing() types of scenarios to reset |
| 1242 | # any existing state. |
| 1243 | state._reset(dict_, key) |
| 1244 | |
| 1245 | populators["new"].append((self.key, reset_for_lazy_callable)) |
| 1246 | |