From a0c8d2f44579c8d446388c1e5c6dd1f1aa467121 Mon Sep 17 00:00:00 2001 From: Kevin Georgy Date: Wed, 16 Aug 2017 10:31:41 +0200 Subject: [PATCH] Add documentation for the coerce_to_string and localize FloatField parameters --- docs/api-guide/fields.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/api-guide/fields.md b/docs/api-guide/fields.md index b93ac389b..538ac0a3c 100644 --- a/docs/api-guide/fields.md +++ b/docs/api-guide/fields.md @@ -250,10 +250,12 @@ A floating point representation. Corresponds to `django.db.models.fields.FloatField`. -**Signature**: `FloatField(max_value=None, min_value=None)` +**Signature**: `FloatField(coerce_to_string=None, max_value=None, min_value=None, localize=False)` +- `coerce_to_string` Set to `True` if string values should be returned for the representation, or `False` if `float` objects should be returned. Defaults to `False`. Note that setting `localize` will force the value to `True`. - `max_value` Validate that the number provided is no greater than this value. - `min_value` Validate that the number provided is no less than this value. +- `localize` Set to `True` to enable localization of input and output based on the current locale. This will also force `coerce_to_string` to `True`. Defaults to `False`. Note that data formatting is enabled if you have set `USE_L10N=True` in your settings file. ## DecimalField