diff options
| author | Jannis Leidel <jannis@leidel.info> | 2010-03-27 16:43:27 +0000 |
|---|---|---|
| committer | Jannis Leidel <jannis@leidel.info> | 2010-03-27 16:43:27 +0000 |
| commit | ca4c6f65ea81109cf6fbdba74da7f5027eb0c4db (patch) | |
| tree | 518379a21d25de1802f68899af42e00d941f05d9 /docs | |
| parent | ad5afd6ed220ed50a2b48d7ccf9786ac0e52f807 (diff) | |
Fixed #13032 - Added localize parameter to form fields to be able to selectively enable localization.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@12867 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/ref/forms/fields.txt | 15 | ||||
| -rw-r--r-- | docs/topics/i18n/localization.txt | 7 |
2 files changed, 22 insertions, 0 deletions
diff --git a/docs/ref/forms/fields.txt b/docs/ref/forms/fields.txt index 22fabb3fa8..396e51046e 100644 --- a/docs/ref/forms/fields.txt +++ b/docs/ref/forms/fields.txt @@ -259,6 +259,7 @@ error message keys it uses. ``validators`` ~~~~~~~~~~~~~~ + .. versionadded:: 1.2 .. attribute:: Field.validators @@ -268,6 +269,20 @@ for this field. See the :ref:`validators documentation <ref-validators>` for more information. +``localize`` +~~~~~~~~~~~~ + +.. versionadded:: 1.2 + +.. attribute:: Field.localize + +The ``localize`` argument enables the localization of form data, input as well +as the rendered output. + +See the :ref:`format localization <format-localization>` documentation for +more information. + + Built-in ``Field`` classes -------------------------- diff --git a/docs/topics/i18n/localization.txt b/docs/topics/i18n/localization.txt index 10e59230e0..8e1beaef46 100644 --- a/docs/topics/i18n/localization.txt +++ b/docs/topics/i18n/localization.txt @@ -268,6 +268,13 @@ Django uses different formats for different locales when guessing the format used by the user when inputting data on forms. Note that Django uses different formats for displaying data, and for parsing it. +To enable a form field to localize input and output data simply use its +``localize`` argument:: + + class CashRegisterForm(forms.Form): + product = forms.CharField() + revenue = forms.DecimalField(max_digits=4, decimal_places=2, localize=True) + Creating custom format files ---------------------------- |
