[Django] #30661: Add support for SmallAutoField.

14 views
Skip to first unread message

Django

unread,
Jul 26, 2019, 6:59:37 PM7/26/19
to django-...@googlegroups.com
#30661: Add support for SmallAutoField.
-------------------------------------+-------------------------------------
Reporter: Nick Pope | Owner: Nick Pope
Type: New | Status: assigned
feature |
Component: Database | Version: master
layer (models, ORM) | Keywords: autofield,
Severity: Normal | smallautofield, smallintegerfield
Triage Stage: | Has patch: 0
Unreviewed |
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
-------------------------------------+-------------------------------------
We have `AutoField` and `BigAutoField` that mirror `IntegerField` and
`BigIntegerField`, but there is no `SmallAutoField` for
`SmallIntegerField`.

It can be useful to have an auto-incrementing 16-bit integer field for
infrequently updated tables that contain a list of choices, e.g.
countries, for systems where limited disk space/memory is available.

(In part this was also a test for the changes in #29979.)

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

Django

unread,
Jul 26, 2019, 7:14:50 PM7/26/19
to django-...@googlegroups.com
#30661: Add support for SmallAutoField.
-------------------------------------+-------------------------------------
Reporter: Nick Pope | Owner: Nick Pope
Type: New feature | Status: assigned
Component: Database layer | Version: master
(models, ORM) |
Severity: Normal | Resolution:
Keywords: autofield, | Triage Stage:
smallautofield, smallintegerfield | Unreviewed
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Nick Pope):

* has_patch: 0 => 1


Comment:

[https://github.com/django/django/pull/10680 PR]

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

Django

unread,
Jul 28, 2019, 4:50:06 AM7/28/19
to django-...@googlegroups.com
#30661: Add support for SmallAutoField.
-------------------------------------+-------------------------------------
Reporter: Nick Pope | Owner: Nick Pope
Type: New feature | Status: assigned
Component: Database layer | Version: master
(models, ORM) |
Severity: Normal | Resolution:
Keywords: autofield, | Triage Stage:
smallautofield, smallintegerfield | Unreviewed
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Carlton Gibson):

Wondering if this is sufficiently useful to be part of core? (It seems a
bit niche.) Seems like the sort of thing we often recommend putting in the
third-party field (and package).

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

Django

unread,
Jul 29, 2019, 3:09:51 AM7/29/19
to django-...@googlegroups.com
#30661: Add support for SmallAutoField.
-------------------------------------+-------------------------------------
Reporter: Nick Pope | Owner: Nick Pope
Type: New feature | Status: assigned
Component: Database layer | Version: master
(models, ORM) |
Severity: Normal | Resolution:
Keywords: autofield, | Triage Stage: Accepted
smallautofield, smallintegerfield |
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by felixxm):

* stage: Unreviewed => Accepted


Comment:

I'm going to accept this based on Anssi's comments
([https://code.djangoproject.com/ticket/14286#comment:9 comment:9] and
[https://code.djangoproject.com/ticket/18201#comment:1 comment:1]). I
think it's worth to add this for consistency and "small" optimization.

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

Django

unread,
Jul 30, 2019, 1:16:24 PM7/30/19
to django-...@googlegroups.com
#30661: Add support for SmallAutoField.
-------------------------------------+-------------------------------------
Reporter: Nick Pope | Owner: Nick Pope
Type: New feature | Status: assigned
Component: Database layer | Version: master
(models, ORM) |
Severity: Normal | Resolution:
Keywords: autofield, | Triage Stage: Accepted
smallautofield, smallintegerfield |
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Nick Pope):

Split into new [https://github.com/django/django/pull/11611 PR].

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

Django

unread,
Aug 2, 2019, 5:43:42 AM8/2/19
to django-...@googlegroups.com
#30661: Add support for SmallAutoField.
-------------------------------------+-------------------------------------
Reporter: Nick Pope | Owner: Nick Pope
Type: New feature | Status: assigned
Component: Database layer | Version: master
(models, ORM) |
Severity: Normal | Resolution:
Keywords: autofield, | Triage Stage: Ready for
smallautofield, smallintegerfield | checkin
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by felixxm):

* stage: Accepted => Ready for checkin


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

Django

unread,
Aug 2, 2019, 7:15:14 AM8/2/19
to django-...@googlegroups.com
#30661: Add support for SmallAutoField.
-------------------------------------+-------------------------------------
Reporter: Nick Pope | Owner: Nick Pope
Type: New feature | Status: closed

Component: Database layer | Version: master
(models, ORM) |
Severity: Normal | Resolution: fixed

Keywords: autofield, | Triage Stage: Ready for
smallautofield, smallintegerfield | checkin
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Mariusz Felisiak <felisiak.mariusz@…>):

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


Comment:

In [changeset:"194d1dfc186cc8d2b35dabf64f3ed38b757cbd98" 194d1dfc]:
{{{
#!CommitTicketReference repository=""
revision="194d1dfc186cc8d2b35dabf64f3ed38b757cbd98"
Fixed #30661 -- Added models.SmallAutoField.
}}}

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

Reply all
Reply to author
Forward
0 new messages