Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

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
Malcolm Tredinnick authored

Showing 2 changed files with 22 additions and 0 deletions. Show diff stats Hide diff stats

  1. 1  AUTHORS
  2. 21  docs/newforms.txt
1  AUTHORS
@@ -141,6 +141,7 @@ answer newbie questions, and generally made Django that much better:
141 141
     Hyun Mi Ae
142 142
     Tom Insam
143 143
     Baurzhan Ismagulov <ibr@radix50.net>
  144
+    james_027@yahoo.com
144 145
     jcrasta@gmail.com
145 146
     Zak Johnson <zakj@nox.cx>
146 147
     Michael Josephson <http://www.sdjournal.com/>
21  docs/newforms.txt
@@ -1129,6 +1129,24 @@ If no ``input_formats`` argument is provided, the default input formats are::
1129 1129
     '%m/%d/%y %H:%M',        # '10/25/06 14:30'
1130 1130
     '%m/%d/%y',              # '10/25/06'
1131 1131
 
  1132
+``DecimalField``
  1133
+~~~~~~~~~~~~~~~~
  1134
+
  1135
+**New in Django development version**
  1136
+
  1137
+    * Default widget: ``TextInput``
  1138
+    * Empty value: ``None``
  1139
+    * Normalizes to: A Python ``decimal``.
  1140
+    * Validates that the given value is a decimal. Leading and trailing
  1141
+      whitespace is ignored.
  1142
+
  1143
+Takes four optional arguments: ``max_value``, ``min_value``, ``max_digits``,
  1144
+and ``decimal_places``. The first two define the limits for the fields value.
  1145
+``max_digits`` is the maximum number of digits (those before the decimal
  1146
+point plus those after the decimal point, with leading zeros stripped)
  1147
+permitted in the value, whilst ``decimal_places`` is the maximum number of
  1148
+decimal places permitted.
  1149
+
1132 1150
 ``EmailField``
1133 1151
 ~~~~~~~~~~~~~~
1134 1152
 
@@ -1199,6 +1217,9 @@ When you use a ``FileField`` on a form, you must also remember to
1199 1217
     * Validates that the given value is an integer. Leading and trailing
1200 1218
       whitespace is allowed, as in Python's ``int()`` function.
1201 1219
 
  1220
+Takes two optional arguments for validation, ``max_value`` and ``min_value``.
  1221
+These control the range of values permitted in the field.
  1222
+
1202 1223
 ``MultipleChoiceField``
1203 1224
 ~~~~~~~~~~~~~~~~~~~~~~~
1204 1225
 

0 notes on commit 20e3ae5

Please sign in to comment.
Something went wrong with that request. Please try again.