Fixed #14286 -- Added models.BigAutoField.

This commit is contained in:
Alexander Sosnovskiy 2015-07-02 11:43:15 +03:00 committed by Tim Graham
parent a1d0c60fa0
commit 2a7ce34600
19 changed files with 260 additions and 20 deletions

View file

@ -388,12 +388,22 @@ according to available IDs. You usually won't need to use this directly; a
primary key field will automatically be added to your model if you don't specify
otherwise. See :ref:`automatic-primary-key-fields`.
``BigAutoField``
----------------
.. class:: BigAutoField(**options)
.. versionadded:: 1.10
A 64-bit integer, much like an :class:`AutoField` except that it is
guaranteed to fit numbers from ``1`` to ``9223372036854775807``.
``BigIntegerField``
-------------------
.. 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 default form widget for this field is a
:class:`~django.forms.TextInput`.

View file

@ -242,6 +242,10 @@ Models
:class:`~django.db.models.Func`. This attribute can be used to set the number
of arguments the function accepts.
* Added :class:`~django.db.models.BigAutoField` which acts much like an
:class:`~django.db.models.AutoField` except that it is guaranteed
to fit numbers from ``1`` to ``9223372036854775807``.
Requests and Responses
^^^^^^^^^^^^^^^^^^^^^^

View file

@ -56,6 +56,8 @@ Model field Form field
=================================== ==================================================
:class:`AutoField` Not represented in the form
:class:`BigAutoField` Not represented in the form
:class:`BigIntegerField` :class:`~django.forms.IntegerField` with
``min_value`` set to -9223372036854775808
and ``max_value`` set to 9223372036854775807.