#36842: Blank FloatField validation is not run on django admin and value is 
lost on
edition.
-------------------------------------+-------------------------------------
     Reporter:  pawel-steto          |                    Owner:  Vishy
                                     |  Algo
         Type:  New feature          |                   Status:  closed
    Component:  contrib.admin        |                  Version:  6.0
     Severity:  Normal               |               Resolution:  wontfix
     Keywords:  admin validation     |             Triage Stage:
  floatfield blank                   |  Unreviewed
    Has patch:  0                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------
Changes (by Jacob Walls):

 * resolution:   => wontfix
 * status:  assigned => closed
 * type:  Uncategorized => New feature

Comment:

 Thanks for the ticket. Admin widgets have used `type="number"` since
 #27199, with the result that nonsense values get cleaned by the browser to
 `""`, and thus never make it to Django.

 If this is not desired, a
 [https://docs.djangoproject.com/en/6.0/topics/forms/#the-template
 workaround] is documented (however, and TIL -- `novalidate` has no effect
 on `type="number"`, so you workarounds are reduced to just using
 `TextWidget`.):

 > If your form includes a URLField, an EmailField or any integer field
 type, Django will use the url, email and number HTML5 input types. By
 default, browsers may apply their own validation on these fields, which
 may be stricter than Django’s validation. If you would like to disable
 this behavior, set the novalidate attribute on the form tag, or specify a
 different widget on the field, like TextInput.

 If your proposal is to revert #27199, it would present compatibility
 concerns and should be discussed first on the
 [https://forum.djangoproject.com/c/internals/5 Forum (internals)].
-- 
Ticket URL: <https://code.djangoproject.com/ticket/36842#comment:2>
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 view this discussion visit 
https://groups.google.com/d/msgid/django-updates/0107019b8fdb382b-9af37e62-cf00-4460-87e4-2e555c42517b-000000%40eu-central-1.amazonses.com.

Reply via email to