mirror of
				https://github.com/django/django.git
				synced 2025-10-31 01:25:32 +00:00 
			
		
		
		
	[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 b6a6cf4ab7 from master.
			
			
This commit is contained in:
		
				
					committed by
					
						 Baptiste Mispelon
						Baptiste Mispelon
					
				
			
			
				
	
			
			
			
						parent
						
							d8fdee7db8
						
					
				
				
					commit
					47abfa237e
				
			| @@ -357,8 +357,9 @@ otherwise. See :ref:`automatic-primary-key-fields`. | |||||||
| .. class:: BigIntegerField([**options]) | .. class:: BigIntegerField([**options]) | ||||||
|  |  | ||||||
| A 64 bit integer, much like an :class:`IntegerField` except that it is | A 64 bit integer, much like an :class:`IntegerField` except that it is | ||||||
| guaranteed to fit numbers from -9223372036854775808 to 9223372036854775807. The | guaranteed to fit numbers from ``-9223372036854775808`` to | ||||||
| default form widget for this field is a :class:`~django.forms.TextInput`. | ``9223372036854775807``. The default form widget for this field is a | ||||||
|  | :class:`~django.forms.TextInput`. | ||||||
|  |  | ||||||
| ``BinaryField`` | ``BinaryField`` | ||||||
| ------------------- | ------------------- | ||||||
| @@ -496,8 +497,8 @@ A fixed-precision decimal number, represented in Python by a | |||||||
|  |  | ||||||
|     The number of decimal places to store with the number. |     The number of decimal places to store with the number. | ||||||
|  |  | ||||||
| For example, to store numbers up to 999 with a resolution of 2 decimal places, | For example, to store numbers up to ``999`` with a resolution of 2 decimal | ||||||
| you'd use:: | places, you'd use:: | ||||||
|  |  | ||||||
|     models.DecimalField(..., max_digits=5, decimal_places=2) |     models.DecimalField(..., max_digits=5, decimal_places=2) | ||||||
|  |  | ||||||
| @@ -837,7 +838,8 @@ length using the :attr:`~CharField.max_length` argument. | |||||||
|  |  | ||||||
| .. class:: IntegerField([**options]) | .. class:: IntegerField([**options]) | ||||||
|  |  | ||||||
| An integer. 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.TextInput`. | ||||||
|  |  | ||||||
| ``IPAddressField`` | ``IPAddressField`` | ||||||
| @@ -894,7 +896,8 @@ widget for this field is a :class:`~django.forms.NullBooleanSelect`. | |||||||
| .. class:: PositiveIntegerField([**options]) | .. class:: PositiveIntegerField([**options]) | ||||||
|  |  | ||||||
| Like an :class:`IntegerField`, but must be either positive or zero (``0``). | Like an :class:`IntegerField`, but must be either positive or zero (``0``). | ||||||
| The value ``0`` is accepted for backward compatibility reasons. | Values from ``0`` to ``2147483647`` are safe in all databases supported by | ||||||
|  | Django. The value ``0`` is accepted for backward compatibility reasons. | ||||||
|  |  | ||||||
| ``PositiveSmallIntegerField`` | ``PositiveSmallIntegerField`` | ||||||
| ----------------------------- | ----------------------------- | ||||||
| @@ -902,8 +905,8 @@ The value ``0`` is accepted for backward compatibility reasons. | |||||||
| .. class:: PositiveSmallIntegerField([**options]) | .. class:: PositiveSmallIntegerField([**options]) | ||||||
|  |  | ||||||
| Like a :class:`PositiveIntegerField`, but only allows values under a certain | Like a :class:`PositiveIntegerField`, but only allows values under a certain | ||||||
| (database-dependent) point. Values up to 32767 are safe in all databases | (database-dependent) point. Values from ``0`` to ``32767`` are safe in all | ||||||
| supported by Django. | databases supported by Django. | ||||||
|  |  | ||||||
| ``SlugField`` | ``SlugField`` | ||||||
| ------------- | ------------- | ||||||
| @@ -931,8 +934,8 @@ of some other value.  You can do this automatically in the admin using | |||||||
| .. class:: SmallIntegerField([**options]) | .. class:: SmallIntegerField([**options]) | ||||||
|  |  | ||||||
| Like an :class:`IntegerField`, but only allows values under a certain | Like an :class:`IntegerField`, but only allows values under a certain | ||||||
| (database-dependent) point. Values from -32768 to 32767 are safe in all databases | (database-dependent) point. Values from ``-32768`` to ``32767``` are safe in all | ||||||
| supported by Django. | databases supported by Django. | ||||||
|  |  | ||||||
| ``TextField`` | ``TextField`` | ||||||
| ------------- | ------------- | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user