mirror of
https://github.com/django/django.git
synced 2025-08-04 19:08:28 +00:00
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
This commit is contained in:
parent
ad5afd6ed2
commit
ca4c6f65ea
7 changed files with 60 additions and 19 deletions
|
@ -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
|
||||
----------------------------
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue