Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

[1.6.x] Fixed #21427 -- Clearly state integer field value ranges in docs

Added an explicit mention of the exact value ranges for integer type
fields that are safe in all databases supported by Django. Also, put
all value numbers inside double ticks.

Backport of b6a6cf4 from master.
  • Loading branch information...
commit 47abfa237e21ca71d8ee901cf8ba1f1c89ae1f2e 1 parent d8fdee7
Markus Amalthea Magnuson authored November 20, 2013 bmispelon committed November 21, 2013

Showing 1 changed file with 13 additions and 10 deletions. Show diff stats Hide diff stats

  1. 23  docs/ref/models/fields.txt
23  docs/ref/models/fields.txt
@@ -357,8 +357,9 @@ otherwise. See :ref:`automatic-primary-key-fields`.
357 357
 .. class:: BigIntegerField([**options])
358 358
 
359 359
 A 64 bit integer, much like an :class:`IntegerField` except that it is
360  
-guaranteed to fit numbers from -9223372036854775808 to 9223372036854775807. The
361  
-default form widget for this field is a :class:`~django.forms.TextInput`.
  360
+guaranteed to fit numbers from ``-9223372036854775808`` to
  361
+``9223372036854775807``. The default form widget for this field is a
  362
+:class:`~django.forms.TextInput`.
362 363
 
363 364
 ``BinaryField``
364 365
 -------------------
@@ -496,8 +497,8 @@ A fixed-precision decimal number, represented in Python by a
496 497
 
497 498
     The number of decimal places to store with the number.
498 499
 
499  
-For example, to store numbers up to 999 with a resolution of 2 decimal places,
500  
-you'd use::
  500
+For example, to store numbers up to ``999`` with a resolution of 2 decimal
  501
+places, you'd use::
501 502
 
502 503
     models.DecimalField(..., max_digits=5, decimal_places=2)
503 504
 
@@ -837,7 +838,8 @@ length using the :attr:`~CharField.max_length` argument.
837 838
 
838 839
 .. class:: IntegerField([**options])
839 840
 
840  
-An integer. The default form widget for this field is a
  841
+An integer. Values from ``-2147483648`` to ``2147483647`` are safe in all
  842
+databases supported by Django. The default form widget for this field is a
841 843
 :class:`~django.forms.TextInput`.
842 844
 
843 845
 ``IPAddressField``
@@ -894,7 +896,8 @@ widget for this field is a :class:`~django.forms.NullBooleanSelect`.
894 896
 .. class:: PositiveIntegerField([**options])
895 897
 
896 898
 Like an :class:`IntegerField`, but must be either positive or zero (``0``).
897  
-The value ``0`` is accepted for backward compatibility reasons.
  899
+Values from ``0`` to ``2147483647`` are safe in all databases supported by
  900
+Django. The value ``0`` is accepted for backward compatibility reasons.
898 901
 
899 902
 ``PositiveSmallIntegerField``
900 903
 -----------------------------
@@ -902,8 +905,8 @@ The value ``0`` is accepted for backward compatibility reasons.
902 905
 .. class:: PositiveSmallIntegerField([**options])
903 906
 
904 907
 Like a :class:`PositiveIntegerField`, but only allows values under a certain
905  
-(database-dependent) point. Values up to 32767 are safe in all databases
906  
-supported by Django.
  908
+(database-dependent) point. Values from ``0`` to ``32767`` are safe in all
  909
+databases supported by Django.
907 910
 
908 911
 ``SlugField``
909 912
 -------------
@@ -931,8 +934,8 @@ of some other value.  You can do this automatically in the admin using
931 934
 .. class:: SmallIntegerField([**options])
932 935
 
933 936
 Like an :class:`IntegerField`, but only allows values under a certain
934  
-(database-dependent) point. Values from -32768 to 32767 are safe in all databases
935  
-supported by Django.
  937
+(database-dependent) point. Values from ``-32768`` to ``32767``` are safe in all
  938
+databases supported by Django.
936 939
 
937 940
 ``TextField``
938 941
 -------------

0 notes on commit 47abfa2

Please sign in to comment.
Something went wrong with that request. Please try again.