#25417: Add a system check for an invalid default on a model field
-------------------------------------+-------------------------------------
     Reporter:  avorio               |                    Owner:  charettes
         Type:  New feature          |                   Status:  closed
    Component:  Core (System         |                  Version:  master
  checks)                            |
     Severity:  Normal               |               Resolution:  fixed
     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
-------------------------------------+-------------------------------------

Comment (by gavinwahl):

 > Do you have any problem adding this check to SILENCED_SYSTEM_CHECKS?

 Yes. This is in a reusable app. I can't make my users silence the check in
 order to use it.

 > That's not true, there's a whole ​documented layer of model validation.

 This validation is only used when called explicitly or when using a
 ModelForm. I expect a validation error from an initial value only to be
 raised if I ask if the model is valid.

 > I'm not entirely sure I understand your use case but wouldn't this
 special handling belong at the form level anyway?

 I need to be able to create the model instances without a form. A form is
 only used later, when the user is ready to edit the object. The initial
 object is created without user interaction.

--
Ticket URL: <https://code.djangoproject.com/ticket/25417#comment:19>
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 django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/064.1cddb5fdb7377d14869a09e482098ea6%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to