From 7ae470cfe229cc858f79985030496700f1073d21 Mon Sep 17 00:00:00 2001 From: Matt Deacalion Stevens Date: Tue, 9 Jun 2015 15:21:23 +0100 Subject: [PATCH] [1.8.x] Clarified the default form widgets for model number fields in docs Backport of 77f3d7adb1d56d4eb5d22a85e8d383602f937790 from master --- docs/ref/models/fields.txt | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/docs/ref/models/fields.txt b/docs/ref/models/fields.txt index 5893a57464..c9a380d437 100644 --- a/docs/ref/models/fields.txt +++ b/docs/ref/models/fields.txt @@ -562,7 +562,9 @@ decimal places:: models.DecimalField(..., max_digits=19, decimal_places=10) -The default form widget for this field is a :class:`~django.forms.TextInput`. +The default form widget for this field is a :class:`~django.forms.NumberInput` +when :attr:`~django.forms.Field.localize` is ``False`` or +:class:`~django.forms.TextInput` otherwise. .. note:: @@ -859,7 +861,9 @@ can change the maximum length using the :attr:`~CharField.max_length` argument. A floating-point number represented in Python by a ``float`` instance. -The default form widget for this field is a :class:`~django.forms.TextInput`. +The default form widget for this field is a :class:`~django.forms.NumberInput` +when :attr:`~django.forms.Field.localize` is ``False`` or +:class:`~django.forms.TextInput` otherwise. .. _floatfield_vs_decimalfield: @@ -914,7 +918,8 @@ The default form widget for this field is a An integer. Values from ``-2147483648`` to ``2147483647`` are safe in all databases supported by Django. The default form widget for this field is a -:class:`~django.forms.TextInput`. +:class:`~django.forms.NumberInput` when :attr:`~django.forms.Field.localize` +is ``False`` or :class:`~django.forms.TextInput` otherwise. ``IPAddressField`` ------------------