{{{
class Foo(models.Model):
pass
class Bar(models.Model):
foo = models.OneToOneField(Foo)
value = models.DecimalField()
>>> foo = Foo.objects.create()
>>> bar = Bar.objects.create(foo=foo, value='1.0')
>>> foo.bar.value == Decimal('1.0')
}}}
The last line passes under 1.4, fails under 1.5+.
I think it would be reasonable to have a flag to Model.save which updates
field attributes to the result of Field.to_python(value), which would plug
this leak.
(I found this issue in production code under test, while upgrading from
1.4 to 1.5 on the way to 1.7.)
--
Ticket URL: <https://code.djangoproject.com/ticket/24028>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
Comment (by timgraham):
IMO, it makes more sense to always have the proposed behavior or never to
have it. A flag seems like unnecessary complexity, but I'll be interested
to see how others feel about this. Maybe it would be good to raise the
issue on django-developers.
--
Ticket URL: <https://code.djangoproject.com/ticket/24028#comment:1>
* stage: Unreviewed => Accepted
Comment:
Marking as accepted as depending on the results of the discussion we could
at least document this behavior as it comes up in support channels once in
a while.
--
Ticket URL: <https://code.djangoproject.com/ticket/24028#comment:2>
Comment (by Tim Graham):
#27825 was a duplicate.
--
Ticket URL: <https://code.djangoproject.com/ticket/24028#comment:3>
* status: new => closed
* resolution: => wontfix
Comment:
Closing as wontfix per the discussion on #27825. The consensus is to
document this limitation.
--
Ticket URL: <https://code.djangoproject.com/ticket/24028#comment:4>