Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fixed #4987 -- Added documentation for newforms.DecimalField. Based o…

…n a patch from james_027@yahoo.com.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@5855 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit 20e3ae5222405d0ec72704a38e80235f725728ee 1 parent 1777e74
@malcolmt malcolmt authored
Showing with 22 additions and 0 deletions.
  1. +1 −0  AUTHORS
  2. +21 −0 docs/newforms.txt
View
1  AUTHORS
@@ -141,6 +141,7 @@ answer newbie questions, and generally made Django that much better:
Hyun Mi Ae
Tom Insam
Baurzhan Ismagulov <ibr@radix50.net>
+ james_027@yahoo.com
jcrasta@gmail.com
Zak Johnson <zakj@nox.cx>
Michael Josephson <http://www.sdjournal.com/>
View
21 docs/newforms.txt
@@ -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', # '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``
~~~~~~~~~~~~~~
@@ -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
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``
~~~~~~~~~~~~~~~~~~~~~~~
Please sign in to comment.
Something went wrong with that request. Please try again.