The gremlin example was just a light-hearted attempt at justifying the claim of "data corruption", in response to Florian, but I really only brought up this issue because it surprised me (nothing in the docs).
I would suggest a docs update to let developers know that if a default isn't set, ``False`` is implied - only because this seems like the sort of mini-"bug" that might never warrant fixing due to the ramifications. On Monday, September 24, 2012 9:18:34 PM UTC-4, Russell Keith-Magee wrote: > > On Tue, Sep 25, 2012 at 8:00 AM, Yo-Yo Ma <baxters...@gmail.com<javascript:>> > wrote: > > Developer of a pet shop software adds: > > > > feed_before_midnight = models.BooleanField() > > > > because they're planning on carrying baby gremlins... forgets to update > the > > zoological XML feed importer to use the "feed_before_midnight" value, > and > > the rest is history :) > > We need to be clear on what we (as in, the Django project) classify as > "catastrophic data loss". > > Examples of Catastrophic data loss: > * You request a save of object X, and object X is not saved. > * You save object X, and object Y is modified. > * You save object X, and object Z is deleted. > > NOT examples of Catastrophic data loss: > * You forget to set a value on an object, and the default isn't what > you expected. > * You set a value on an object, which is saved verbatim, but wasn't > the correct value under the circumstances. > > In the example you provide, I agree that there would be catastrophic > consequences. However, the code is doing exactly what it's instructed > to do. While I may concede that this is a bug, it's a bug caused by > ambiguous default behaviour, not behaviour that is fundamentally > incorrect or destructive -- it's essentially nothing more than "0 is a > default value". You can argue that 0 isn't an appropriate default in > this circumstance, but you can't argue that it is (a) a particularly > surprising default, or (b) that the developer was given an opportunity > (multiple opportunities, really) to set an appropriate default. > > If this conflicts with what you consider to be catastrophic, thats > fine -- I'm just letting you know the benchmark that we, as a project, > use to guide our decision making process. > > Yours, > Russ Magee %-) > -- You received this message because you are subscribed to the Google Groups "Django developers" group. To view this discussion on the web visit https://groups.google.com/d/msg/django-developers/-/YO9PTOVrakUJ. To post to this group, send email to django-developers@googlegroups.com. To unsubscribe from this group, send email to django-developers+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-developers?hl=en.