Changes between Initial Version and Version 1 of Ticket #28856


Ignore:
Timestamp:
Nov 28, 2017, 4:02:13 PM (7 years ago)
Author:
Morgan Wahl
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #28856 – Description

    initial v1  
    3030}}}
    3131
    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.)
     32Each 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.
    3333
    3434I've written a regression test against stable/1.10.x . I'll attach a patch.
Back to Top