diff options
| author | Malcolm Tredinnick <malcolm.tredinnick@gmail.com> | 2007-08-11 12:10:23 +0000 |
|---|---|---|
| committer | Malcolm Tredinnick <malcolm.tredinnick@gmail.com> | 2007-08-11 12:10:23 +0000 |
| commit | 20e3ae5222405d0ec72704a38e80235f725728ee (patch) | |
| tree | 4f27203f98d4d91fd9f512b5e799a775e5e58262 /docs/newforms.txt | |
| parent | 1777e74d2a53f2b36a3106563c629f85133fbace (diff) | |
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
Diffstat (limited to 'docs/newforms.txt')
| -rw-r--r-- | docs/newforms.txt | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/docs/newforms.txt b/docs/newforms.txt index 4be0fe492b..800c13b52a 100644 --- a/docs/newforms.txt +++ b/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`` ~~~~~~~~~~~~~~~~~~~~~~~ |
