Changes between Initial Version and Version 1 of Ticket #28856
- Timestamp:
- Nov 28, 2017, 4:02:13 PM (7 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #28856 – Description
initial v1 30 30 }}} 31 31 32 Each time `ref.obj` is accessed, a new instance is created for its value. This is a problem, since doing something like `ref.obj.field = 1; ref.obj.save()` won't actually update the field in the database. This only happens when the referenced object is an instance of a model that subclasses another model. (So, it wouldn't happen if referencing `OtherSuper` in the models above.) 32 Each time `ref.obj` is accessed, a new instance is created for its value. This is a problem, since doing something like `ref.obj.field = 1; ref.obj.save()` won't actually update the field in the database. This only happens when the referenced object is an instance of a model that subclasses another model. (So, it wouldn't happen if referencing `OtherSuper` in the models above.) The `refresh_from_db()` call is also necessary to reproduce this in a simple test like the above; it happens with any instance created from an existing DB record. 33 33 34 34 I've written a regression test against stable/1.10.x . I'll attach a patch.