#25417: Add a system check for an invalid default on a model field
-------------------------------------+-------------------------------------
     Reporter:  avorio               |                    Owner:  charettes
         Type:  New feature          |                   Status:  new
    Component:  Core (System         |                  Version:  master
  checks)                            |
     Severity:  Normal               |               Resolution:
     Keywords:  decimal,             |             Triage Stage:  Ready for
  InvalidOperation, migrations       |  checkin
    Has patch:  1                    |      Needs documentation:  1
  Needs tests:  0                    |  Patch needs improvement:  1
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------
Changes (by gavinwahl):

 * status:  closed => new
 * needs_better_patch:  0 => 1
 * resolution:  fixed =>
 * needs_docs:  0 => 1


Comment:

 This change is not backwards compatible and isn't a valid fix for the
 original issue. Validation in Django only happens through forms, and is
 bypassed when manipulating a model directly. The precedent in Django is to
 allow creation of models that don't actually validate.

 I use fields with `blank=False, default=''` to create a model with empty
 content that's only validated when a user edits it through a form.

 I don't understand how this is a Django bug at all. The opener of the bug
 is doing something wrong with Decimals, and got a decimal.InvalidOperation
 error. That seems like what should happen.

--
Ticket URL: <https://code.djangoproject.com/ticket/25417#comment:15>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/064.e1ca4f82023efc042a0161149f31b5c9%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to