[Django] #21427: Clearly state the value range of all integer type fields in the model field documentation

10 views
Skip to first unread message

Django

unread,
Nov 12, 2013, 12:07:03 PM11/12/13
to django-...@googlegroups.com
#21427: Clearly state the value range of all integer type fields in the model field
documentation
--------------------------------------+--------------------
Reporter: giuliettamasina | Owner: nobody
Type: Cleanup/optimization | Status: new
Component: Documentation | Version:
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Easy pickings: 0 | UI/UX: 0
--------------------------------------+--------------------
The documentation for BigIntegerField, PositiveSmallIntegerField and
SmallIntegerField clearly state what integer values fit into that field's
size:

https://docs.djangoproject.com/en/dev/ref/models/fields/#bigintegerfield
https://docs.djangoproject.com/en/dev/ref/models/fields/#positivesmallintegerfield
https://docs.djangoproject.com/en/dev/ref/models/fields/#smallintegerfield

But these do not state the same info:

https://docs.djangoproject.com/en/dev/ref/models/fields/#integerfield
https://docs.djangoproject.com/en/dev/ref/models/fields/#positiveintegerfield


For clarity, I think all of the above fields should be documented with a
standardized sentence like this:

'''"Values from X to Y are safe in all databases supported by Django."'''

--
Ticket URL: <https://code.djangoproject.com/ticket/21427>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Nov 13, 2013, 11:59:30 AM11/13/13
to django-...@googlegroups.com
#21427: Clearly state the value range of all integer type fields in the model field
documentation
--------------------------------------+------------------------------------

Reporter: giuliettamasina | Owner: nobody
Type: Cleanup/optimization | Status: new
Component: Documentation | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
--------------------------------------+------------------------------------
Changes (by timo):

* needs_better_patch: => 0
* version: => master
* needs_docs: => 0
* needs_tests: => 0
* stage: Unreviewed => Accepted


--
Ticket URL: <https://code.djangoproject.com/ticket/21427#comment:1>

Django

unread,
Nov 20, 2013, 5:01:21 PM11/20/13
to django-...@googlegroups.com
#21427: Clearly state the value range of all integer type fields in the model field
documentation
--------------------------------------+------------------------------------

Reporter: giuliettamasina | Owner: nobody
Type: Cleanup/optimization | Status: new
Component: Documentation | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
--------------------------------------+------------------------------------

Comment (by giuliettamasina):

Opened a pull request here: https://github.com/django/django/pull/1949

--
Ticket URL: <https://code.djangoproject.com/ticket/21427#comment:2>

Django

unread,
Nov 20, 2013, 6:51:13 PM11/20/13
to django-...@googlegroups.com
#21427: Clearly state the value range of all integer type fields in the model field
documentation
-------------------------------------+-------------------------------------
Reporter: giuliettamasina | Owner: nobody
Type: | Status: new
Cleanup/optimization | Version: master
Component: Documentation | Resolution:
Severity: Normal | Triage Stage: Ready for
Keywords: | checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by timo):

* has_patch: 0 => 1
* stage: Accepted => Ready for checkin


Comment:

Assuming the ranges are correct, this looks good. Could you amend your PR
to follow the
[https://docs.djangoproject.com/en/dev/internals/contributing/committing-
code/#committing-guidelines commit message guidelines]? Also, don't forget
to check "Has patch" so the ticket appears in the review queue. Thanks!

--
Ticket URL: <https://code.djangoproject.com/ticket/21427#comment:3>

Django

unread,
Nov 21, 2013, 2:37:36 AM11/21/13
to django-...@googlegroups.com
#21427: Clearly state the value range of all integer type fields in the model field
documentation
--------------------------------------+------------------------------------

Reporter: giuliettamasina | Owner: nobody
Type: Cleanup/optimization | Status: new
Component: Documentation | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
--------------------------------------+------------------------------------
Changes (by claudep):

* stage: Ready for checkin => Accepted


Comment:

Sorry, but I'd like to know where do the new figures come from. Could you
please document here your findings (with appropriate links to backends
documentation)?

--
Ticket URL: <https://code.djangoproject.com/ticket/21427#comment:4>

Django

unread,
Nov 21, 2013, 4:42:12 AM11/21/13
to django-...@googlegroups.com
#21427: Clearly state the value range of all integer type fields in the model field
documentation
--------------------------------------+------------------------------------

Reporter: giuliettamasina | Owner: nobody
Type: Cleanup/optimization | Status: new
Component: Documentation | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
--------------------------------------+------------------------------------

Comment (by giuliettamasina):

Sorry, I did not do my homework properly, and the values were not correct.

I've now corrected them and opened a new pull request (following commit
message guidelines): https://github.com/django/django/pull/1955

The values and their sources are as follows:

'''MySQL'''
IntegerField (integer): -2147483648 to 2147483647
PositiveIntegerField (integer UNSIGNED): 0 to 2147483647
PositiveSmallIntegerField (smallint UNSIGNED): 0 to 32767
Source: http://dev.mysql.com/doc/refman/5.0/en/integer-types.html

'''Postgres'''
IntegerField (integer): -2147483648 to 2147483647
PositiveIntegerField (integer): 0 to 2147483647
PositiveSmallIntegerField (smallint): 0 to 32767
Source: http://www.postgresql.org/docs/devel/static/datatype-numeric.html

'''Oracle'''
IntegerField (NUMBER(11)): -99999999999 to 99999999999
PositiveIntegerField (NUMBER(11)): 0 to 99999999999
PositiveSmallIntegerField (NUMBER(11)): 0 to 99999999999
Source:
http://docs.oracle.com/cd/E11882_01/server.112/e25513/limits001.htm

'''SQLite'''
("1, 2, 3, 4, 6, or 8 bytes depending on the magnitude of the value.")
IntegerField (integer): -9223372036854775808 to 9223372036854775807
PositiveIntegerField (integer unsigned): 0 to 9223372036854775807
PositiveSmallIntegerField (smallint unsigned): 0 to 9223372036854775807
Source: http://www.sqlite.org/datatype3.html

--
Ticket URL: <https://code.djangoproject.com/ticket/21427#comment:5>

Django

unread,
Nov 21, 2013, 6:39:40 AM11/21/13
to django-...@googlegroups.com
#21427: Clearly state the value range of all integer type fields in the model field
documentation
-------------------------------------+-------------------------------------
Reporter: giuliettamasina | Owner: nobody

Type: | Status: new
Cleanup/optimization | Version: master
Component: Documentation | Resolution:
Severity: Normal | Triage Stage: Ready for
Keywords: | checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by bmispelon):

* stage: Accepted => Ready for checkin


Comment:

Everything looks good.

Thanks for finding all the references too, this is very valuable.

I'll mark the ticket as `ready for checkin` and commit it later today if
no one does it before.

--
Ticket URL: <https://code.djangoproject.com/ticket/21427#comment:6>

Django

unread,
Nov 21, 2013, 8:17:15 AM11/21/13
to django-...@googlegroups.com
#21427: Clearly state the value range of all integer type fields in the model field
documentation
-------------------------------------+-------------------------------------
Reporter: giuliettamasina | Owner: nobody
Type: | Status: closed
Cleanup/optimization | Version: master
Component: Documentation | Resolution: fixed

Severity: Normal | Triage Stage: Ready for
Keywords: | checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Baptiste Mispelon <bmispelon@…>):

* status: new => closed
* resolution: => fixed


Comment:

In [changeset:"b6a6cf4ab791b092e18ab16537aa88dd7ae9bc36"]:
{{{
#!CommitTicketReference repository=""
revision="b6a6cf4ab791b092e18ab16537aa88dd7ae9bc36"
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.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/21427#comment:7>

Django

unread,
Nov 21, 2013, 8:18:29 AM11/21/13
to django-...@googlegroups.com
#21427: Clearly state the value range of all integer type fields in the model field
documentation
-------------------------------------+-------------------------------------
Reporter: giuliettamasina | Owner: nobody

Type: | Status: closed
Cleanup/optimization | Version: master
Component: Documentation | Resolution: fixed
Severity: Normal | Triage Stage: Ready for
Keywords: | checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Baptiste Mispelon <bmispelon@…>):

In [changeset:"47abfa237e21ca71d8ee901cf8ba1f1c89ae1f2e"]:
{{{
#!CommitTicketReference repository=""
revision="47abfa237e21ca71d8ee901cf8ba1f1c89ae1f2e"
[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 b6a6cf4ab791b092e18ab16537aa88dd7ae9bc36 from master.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/21427#comment:8>

Reply all
Reply to author
Forward
0 new messages