#15775: Can't enter scientific notation in decimal fields
------------------------------------+------------------------
Reporter: gregthe1 | Owner: nobody
Type: Bug | Status: new
Milestone: | Component: Forms
Version: 1.2 | Severity: Normal
Resolution: | Keywords:
Triage Stage: Accepted | Has patch: 1
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 1 | Easy pickings: 0
UI/UX: 0 |
------------------------------------+------------------------
Changes (by aaugustin):
* needs_better_patch: 0 => 1
Comment:
I suggest the following changes to the patch, by order of decreasing
importance.
You should use `TestCase` from `django.utils.unittest`, which is already
imported, and not from `django.test`, since you're not using the extra
features of `django.test.TestCase`.
{{{
f.validate(Decimal('1E+2')) # Ensure that scientific notation
with positive exponent is accepted (#15775)
}}}
would be more readable as:
{{{
# regression test for #15775: scientific notation with
positive exponent is valid
f.validate(Decimal('1E+2'))
}}}
You may try to re-wrap a bit `django/forms/fields.py`. It's hard to read
140-chars lines — the coding rules recommend wrapping at 80 chars.
You're missing a `\n` at the end of the file (look at your patch in Trac).
--
Ticket URL: <https://code.djangoproject.com/ticket/15775#comment:5>
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 post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/django-updates?hl=en.