* ui_ux: => 0
* easy: => 0
Comment:
Hello guys,
Since 1.4 is to be released soon™, could this feature be integrated into
it? I looked in the trunk and did not find it. It shouldn't have much
impact on anything.
I could perform the integration of the patch proposed by mmcnickle, but
since I'm new here, I'm not sure if I can :)
Thanks!!! Django is a wonderfull piece of software o/
--
Ticket URL: <https://code.djangoproject.com/ticket/14286#comment:6>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* cc: mvantellingen (added)
--
Ticket URL: <https://code.djangoproject.com/ticket/14286#comment:7>
* cc: sergeykolosov (added)
--
Ticket URL: <https://code.djangoproject.com/ticket/14286#comment:8>
Comment (by akaariai):
#18201 asked for tinyint and smallint based `AutoFields`. If bigint based
fields is added in this ticket, it would make sense to add smallint based
!AutoField, too.
--
Ticket URL: <https://code.djangoproject.com/ticket/14286#comment:9>
* cc: ethan.jucovy@… (added)
--
Ticket URL: <https://code.djangoproject.com/ticket/14286#comment:10>
Comment (by jacob):
#20001 has an alternate patch.
--
Ticket URL: <https://code.djangoproject.com/ticket/14286#comment:11>
Comment (by jamercee):
This week we upgraded to from 1.3 -> 1.5, and discovered BigAutoField was
not yet included in Django. I know this issue has been referenced in a
number of tickets over the years. In Django 1.3, we went with the
mmcnickle approach discussed in this ticket, but found this difficult to
merge into 1.5.
This time, we went with the approach approach suggested by pzinovkin in
ticket 56
(https://code.djangoproject.com/attachment/ticket/56/56_bigint.diff). It
required tweaking to get it to work cleanly with 1.5
Attached are patches derived from a git clone this morning.
--
Ticket URL: <https://code.djangoproject.com/ticket/14286#comment:12>
Comment (by clintonb):
What needs to be done to move this patch to completion and integration?
--
Ticket URL: <https://code.djangoproject.com/ticket/14286#comment:13>
Comment (by anonymous):
Someone from a big corporation that uses django to request it
--
Ticket URL: <https://code.djangoproject.com/ticket/14286#comment:14>
Comment (by aaugustin):
Judging by the ticket's flage, tests need to be written (at least).
--
Ticket URL: <https://code.djangoproject.com/ticket/14286#comment:15>
* cc: ludo@… (added)
--
Ticket URL: <https://code.djangoproject.com/ticket/14286#comment:16>
Comment (by xsanch@…):
Replying to [comment:12 jamercee]:
> This week we upgraded to from 1.3 -> 1.5, and discovered BigAutoField
was not yet included in Django. I know this issue has been referenced in a
number of tickets over the years. In Django 1.3, we went with the
mmcnickle approach discussed in this ticket, but found this difficult to
merge into 1.5.
>
> This time, we went with the approach approach suggested by pzinovkin in
ticket 56
(https://code.djangoproject.com/attachment/ticket/56/56_bigint.diff). It
required tweaking to get it to work cleanly with 1.5
>
> Attached are patches derived from a git clone this morning.
I tried to apply the patch to my 1.5 Django release:
patch -p1 --dry-run -r /var/tmp/reject.txt < bigauto.diff
patching file django/db/backends/__init__.py
Hunk #1 succeeded at 901 (offset -154 lines).
patching file django/db/backends/mysql/creation.py
Hunk #1 FAILED at 7.
1 out of 1 hunk FAILED -- saving rejects to file /var/tmp/reject.txt
patching file django/db/backends/oracle/creation.py
Hunk #1 FAILED at 17.
1 out of 1 hunk FAILED -- saving rejects to file /var/tmp/reject.txt
patching file django/db/backends/postgresql_psycopg2/creation.py
Hunk #1 FAILED at 11.
1 out of 1 hunk FAILED -- saving rejects to file /var/tmp/reject.txt
patching file django/db/backends/sqlite3/base.py
Hunk #1 succeeded at 214 (offset -34 lines).
patching file django/db/backends/sqlite3/creation.py
Hunk #1 FAILED at 9.
1 out of 1 hunk FAILED -- saving rejects to file /var/tmp/reject.txt
patching file django/db/models/fields/__init__.py
Hunk #1 succeeded at 213 (offset -2 lines).
Hunk #2 succeeded at 240 (offset -2 lines).
Hunk #3 succeeded at 531 (offset -8 lines).
Hunk #4 succeeded at 1158 (offset -8 lines).
Hunk #5 succeeded at 1174 (offset -8 lines).
patching file django/db/models/fields/related.py
Hunk #1 succeeded at 1092 (offset -21 lines).
patching file docs/ref/models/fields.txt
Hunk #1 FAILED at 331.
1 out of 1 hunk FAILED -- saving rejects to file /var/tmp/reject.txt
The version of Django is 1.5.0. Could someone tell me what am I doing
wrong ?
Thanks,
Jorge
--
Ticket URL: <https://code.djangoproject.com/ticket/14286#comment:17>
Comment (by stodge):
Has there been any progress on this ticket? Is there a chance it will be
included (and back-ported to 1.6)?
--
Ticket URL: <https://code.djangoproject.com/ticket/14286#comment:18>
* cc: stodge@… (added)
--
Ticket URL: <https://code.djangoproject.com/ticket/14286#comment:19>
Comment (by timgraham):
I don't see any progress. It would be included in Django 1.8 at the
earliest. You can read about our
[https://docs.djangoproject.com/en/dev/internals/release-process
/#supported-versions support versions policy].
--
Ticket URL: <https://code.djangoproject.com/ticket/14286#comment:20>
Comment (by skirsdeda):
I have patches for 1.6 and 1.7 ATM in my django fork:
Commit (patch) for 1.6:
https://github.com/skirsdeda/django/commit/089fc7f165fb6cb7eb851b81a44660a986797946
Commit (patch) for 1.7:
https://github.com/skirsdeda/django/commit/b0a567cc3fa7083ddcdca4f291b1e6d7fa85f6c7
It seems db backend implementation is changed a bit in master branch, so
more work is needed. But I'm planning to do this sometime soonish.
--
Ticket URL: <https://code.djangoproject.com/ticket/14286#comment:21>
Comment (by dcramer):
What needs done to make this happen?
It's pretty painful to modify these kinds of things currently and Sentry
hit BIGINT quite a while back.
I'm attempting to hack this up but these are pretty deep internals and
while I haven't given up I've yet to make things work.
Specifically the primary issue right now that we've hit with just doing it
externally is with foreign keys:
https://github.com/getsentry/sentry/issues/1354#issuecomment-68393116
--
Ticket URL: <https://code.djangoproject.com/ticket/14286#comment:22>
Comment (by dcramer):
In fact, I'd propose a new API be added to keys: "get_related_db_type" (or
something along these lines)
I'm implement a custom ForeignKey locally that will do this, and allow
BigAutoField to return BigIntegerField().db_type(connection)
--
Ticket URL: <https://code.djangoproject.com/ticket/14286#comment:23>
Comment (by dcramer):
Related, here's our terrible solution to this in Sentry:
https://github.com/getsentry/sentry/commit/f34cf31dd31633910daa3fb992e933e5fd62911f
Specifically..
- BigAutoField:
https://github.com/getsentry/sentry/blob/f34cf31dd31633910daa3fb992e933e5fd62911f/src/sentry/db/models/fields/bounded.py#L67
- FlexibleForeignKey:
https://github.com/getsentry/sentry/blob/f34cf31dd31633910daa3fb992e933e5fd62911f/src/sentry/db/models/fields/foreignkey.py#L17
--
Ticket URL: <https://code.djangoproject.com/ticket/14286#comment:24>
Comment (by hhowe29):
Replying to [comment:23 dcramer]:
> In fact, I'd propose a new API be added to keys: "get_related_db_type"
(or something along these lines)
Yes please. Currently, ForeignKey.db_type is too tightly coupled to
AutoField and IntegerField. There should be a new method that ForeignKey
can call to ask the related field what SQL should be used to create a
foreign key to that type. BitAutoField would return 'bigint'. AutoField
would return a regular int. Most fields would simply defer to what db_type
already returns.
Someone has already submitted this: #13774
--
Ticket URL: <https://code.djangoproject.com/ticket/14286#comment:25>
* cc: cmawebsite@… (added)
--
Ticket URL: <https://code.djangoproject.com/ticket/14286#comment:26>
* cc: drakkan (added)
--
Ticket URL: <https://code.djangoproject.com/ticket/14286#comment:27>
* cc: samir (added)
--
Ticket URL: <https://code.djangoproject.com/ticket/14286#comment:29>
* cc: mike@… (added)
--
Ticket URL: <https://code.djangoproject.com/ticket/14286#comment:30>
* cc: marti@… (added)
--
Ticket URL: <https://code.djangoproject.com/ticket/14286#comment:31>
* needs_tests: 1 => 0
--
Ticket URL: <https://code.djangoproject.com/ticket/14286#comment:32>
* stage: Accepted => Unreviewed
--
Ticket URL: <https://code.djangoproject.com/ticket/14286#comment:33>
* stage: Unreviewed => Ready for checkin
--
Ticket URL: <https://code.djangoproject.com/ticket/14286#comment:34>
* stage: Ready for checkin => Accepted
Comment:
Sorry, but you are not supposed to mark your own patches as RFC.
--
Ticket URL: <https://code.djangoproject.com/ticket/14286#comment:35>
* needs_better_patch: 0 => 1
Comment:
Added some comments for improvement on the pull request.
--
Ticket URL: <https://code.djangoproject.com/ticket/14286#comment:36>
* needs_better_patch: 1 => 0
--
Ticket URL: <https://code.djangoproject.com/ticket/14286#comment:37>
* needs_better_patch: 0 => 1
Comment:
I left another round of mostly cosmetic comments, looks like it's almost
there.
--
Ticket URL: <https://code.djangoproject.com/ticket/14286#comment:38>
* needs_better_patch: 1 => 0
--
Ticket URL: <https://code.djangoproject.com/ticket/14286#comment:39>
* status: new => closed
* resolution: => fixed
Comment:
In [changeset:"2a7ce34600d0f879e93c9a5e02215948ed3bb6ac" 2a7ce346]:
{{{
#!CommitTicketReference repository=""
revision="2a7ce34600d0f879e93c9a5e02215948ed3bb6ac"
Fixed #14286 -- Added models.BigAutoField.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/14286#comment:40>