mirror of
https://github.com/django/django.git
synced 2025-01-03 06:55:47 +00:00
Fixed #4987 -- Added documentation for newforms.DecimalField. Based on a patch from james_027@yahoo.com.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@5855 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
1777e74d2a
commit
20e3ae5222
1
AUTHORS
1
AUTHORS
@ -141,6 +141,7 @@ answer newbie questions, and generally made Django that much better:
|
|||||||
Hyun Mi Ae
|
Hyun Mi Ae
|
||||||
Tom Insam
|
Tom Insam
|
||||||
Baurzhan Ismagulov <ibr@radix50.net>
|
Baurzhan Ismagulov <ibr@radix50.net>
|
||||||
|
james_027@yahoo.com
|
||||||
jcrasta@gmail.com
|
jcrasta@gmail.com
|
||||||
Zak Johnson <zakj@nox.cx>
|
Zak Johnson <zakj@nox.cx>
|
||||||
Michael Josephson <http://www.sdjournal.com/>
|
Michael Josephson <http://www.sdjournal.com/>
|
||||||
|
@ -1129,6 +1129,24 @@ If no ``input_formats`` argument is provided, the default input formats are::
|
|||||||
'%m/%d/%y %H:%M', # '10/25/06 14:30'
|
'%m/%d/%y %H:%M', # '10/25/06 14:30'
|
||||||
'%m/%d/%y', # '10/25/06'
|
'%m/%d/%y', # '10/25/06'
|
||||||
|
|
||||||
|
``DecimalField``
|
||||||
|
~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
**New in Django development version**
|
||||||
|
|
||||||
|
* Default widget: ``TextInput``
|
||||||
|
* Empty value: ``None``
|
||||||
|
* Normalizes to: A Python ``decimal``.
|
||||||
|
* Validates that the given value is a decimal. Leading and trailing
|
||||||
|
whitespace is ignored.
|
||||||
|
|
||||||
|
Takes four optional arguments: ``max_value``, ``min_value``, ``max_digits``,
|
||||||
|
and ``decimal_places``. The first two define the limits for the fields value.
|
||||||
|
``max_digits`` is the maximum number of digits (those before the decimal
|
||||||
|
point plus those after the decimal point, with leading zeros stripped)
|
||||||
|
permitted in the value, whilst ``decimal_places`` is the maximum number of
|
||||||
|
decimal places permitted.
|
||||||
|
|
||||||
``EmailField``
|
``EmailField``
|
||||||
~~~~~~~~~~~~~~
|
~~~~~~~~~~~~~~
|
||||||
|
|
||||||
@ -1199,6 +1217,9 @@ When you use a ``FileField`` on a form, you must also remember to
|
|||||||
* Validates that the given value is an integer. Leading and trailing
|
* Validates that the given value is an integer. Leading and trailing
|
||||||
whitespace is allowed, as in Python's ``int()`` function.
|
whitespace is allowed, as in Python's ``int()`` function.
|
||||||
|
|
||||||
|
Takes two optional arguments for validation, ``max_value`` and ``min_value``.
|
||||||
|
These control the range of values permitted in the field.
|
||||||
|
|
||||||
``MultipleChoiceField``
|
``MultipleChoiceField``
|
||||||
~~~~~~~~~~~~~~~~~~~~~~~
|
~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user