[Django] #17337: [nonrel] Support for non-integer primary keys

classic Classic list List threaded Threaded
10 messages Options
Reply | Threaded
Open this post in threaded view
|

[Django] #17337: [nonrel] Support for non-integer primary keys

Django
#17337: [nonrel] Support for non-integer primary keys
----------------------------------------------+--------------------
     Reporter:  jonash                        |      Owner:  nobody
         Type:  Uncategorized                 |     Status:  new
    Component:  Database layer (models, ORM)  |    Version:  SVN
     Severity:  Normal                        |   Keywords:  nonrel
 Triage Stage:  Unreviewed                    |  Has patch:  1
Easy pickings:  0                             |      UI/UX:  0
----------------------------------------------+--------------------
 (This patch is part of the changes made to the inofficial fork "Django-
 nonrel" which adds basic support for non-relational databases.)

 This patch adds basic support for non-integer primary keys. It works by
 not restricting primary keys to `int` and factoring out pk validation/type
 conversion into the backend.

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

--
You received this message because you are subscribed to the Google Groups "Django updates" group.
To post to this group, send email to [hidden email].
To unsubscribe from this group, send email to [hidden email].
For more options, visit this group at http://groups.google.com/group/django-updates?hl=en.

Reply | Threaded
Open this post in threaded view
|

Re: [Django] #17337: [nonrel] Support for non-integer primary keys

Django
#17337: [nonrel] Support for non-integer primary keys
-------------------------------------+-------------------------------------
     Reporter:  jonash               |                    Owner:  nobody
         Type:  Uncategorized        |                   Status:  new
    Component:  Database layer       |                  Version:  SVN
  (models, ORM)                      |               Resolution:
     Severity:  Normal               |             Triage Stage:  Accepted
     Keywords:  nonrel               |      Needs documentation:  0
    Has patch:  1                    |  Patch needs improvement:  0
  Needs tests:  0                    |                    UI/UX:  0
Easy pickings:  0                    |
-------------------------------------+-------------------------------------
Changes (by carljm):

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


Comment:

 Accepting the ticket, as support for non-integer auto-fields is certainly
 desirable. I believe there's a different implementation of it in Alex
 Gaynor's 2010 GSoC code - I don't know which implementation is preferable.

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

--
You received this message because you are subscribed to the Google Groups "Django updates" group.
To post to this group, send email to [hidden email].
To unsubscribe from this group, send email to [hidden email].
For more options, visit this group at http://groups.google.com/group/django-updates?hl=en.

Reply | Threaded
Open this post in threaded view
|

Re: [Django] #17337: [nonrel] Support for non-integer primary keys

Django
In reply to this post by Django
#17337: [nonrel] Support for non-integer primary keys
-------------------------------------+-------------------------------------
     Reporter:  jonash               |                    Owner:  nobody
         Type:  Uncategorized        |                   Status:  new
    Component:  Database layer       |                  Version:  SVN
  (models, ORM)                      |               Resolution:
     Severity:  Normal               |             Triage Stage:  Accepted
     Keywords:  nonrel               |      Needs documentation:  0
    Has patch:  1                    |  Patch needs improvement:  0
  Needs tests:  0                    |                    UI/UX:  0
Easy pickings:  0                    |
-------------------------------------+-------------------------------------

Comment (by russellm):

 IIRC, Alex's GSoC code punted on this issue (or, at least, had code that
 wasn't suitable for trunk), because we couldn't come up with a way to
 introduce it without introducing backwards incompatibilities. I seem to
 recall there were a bunch of places in the code that assumed that
 AutoFields were integers; however, it's been a while, so I might be mis-
 remembering.

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

--
You received this message because you are subscribed to the Google Groups "Django updates" group.
To post to this group, send email to [hidden email].
To unsubscribe from this group, send email to [hidden email].
For more options, visit this group at http://groups.google.com/group/django-updates?hl=en.

Reply | Threaded
Open this post in threaded view
|

Re: [Django] #17337: [nonrel] Support for non-integer primary keys

Django
In reply to this post by Django
#17337: [nonrel] Support for non-integer primary keys
-------------------------------------+-------------------------------------
     Reporter:  jonash               |                    Owner:  nobody
         Type:  Uncategorized        |                   Status:  new
    Component:  Database layer       |                  Version:  SVN
  (models, ORM)                      |               Resolution:
     Severity:  Normal               |             Triage Stage:  Accepted
     Keywords:  nonrel               |      Needs documentation:  0
    Has patch:  1                    |  Patch needs improvement:  0
  Needs tests:  0                    |                    UI/UX:  0
Easy pickings:  0                    |
-------------------------------------+-------------------------------------

Comment (by jonash):

 A few contrib apps assume PKs to be integers and also it gets tricky when
 it comes to testing with fixtures. Should we address all these issues at
 once or fix them bit by bit in multiple tickets?

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

--
You received this message because you are subscribed to the Google Groups "Django updates" group.
To post to this group, send email to [hidden email].
To unsubscribe from this group, send email to [hidden email].
For more options, visit this group at http://groups.google.com/group/django-updates?hl=en.

Reply | Threaded
Open this post in threaded view
|

Re: [Django] #17337: [nonrel] Support for non-integer primary keys

Django
In reply to this post by Django
#17337: [nonrel] Support for non-integer primary keys
-------------------------------------+-------------------------------------
     Reporter:  jonash               |                    Owner:  nobody
         Type:  Bug                  |                   Status:  new
    Component:  Database layer       |                  Version:  SVN
  (models, ORM)                      |               Resolution:
     Severity:  Normal               |             Triage Stage:  Accepted
     Keywords:  nonrel               |      Needs documentation:  0
    Has patch:  1                    |  Patch needs improvement:  0
  Needs tests:  0                    |                    UI/UX:  0
Easy pickings:  0                    |
-------------------------------------+-------------------------------------
Changes (by aaugustin):

 * type:  Uncategorized => Bug


Comment:

 Two tickets (#17214, #17122)  were recently reported about problems in the
 admin with models using non-integer primary keys. A quick
 [https://code.djangoproject.com/search?q=primary_key&noquickjump=1&ticket=on
 search for "primary_key"] turns up lots of other problems with non-integer
 primary keys. Clearly people are trying to use them, and as far as I can
 see, [https://docs.djangoproject.com/en/dev/ref/models/fields/#primary-key
 the docs] don't forbid it.

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

--
You received this message because you are subscribed to the Google Groups "Django updates" group.
To post to this group, send email to [hidden email].
To unsubscribe from this group, send email to [hidden email].
For more options, visit this group at http://groups.google.com/group/django-updates?hl=en.

Reply | Threaded
Open this post in threaded view
|

Re: [Django] #17337: [nonrel] Support for non-integer automatic primary keys (was: [nonrel] Support for non-integer primary keys)

Django
In reply to this post by Django
#17337: [nonrel] Support for non-integer automatic primary keys
-------------------------------------+-------------------------------------
     Reporter:  jonash               |                    Owner:  nobody
         Type:  Bug                  |                   Status:  new
    Component:  Database layer       |                  Version:  SVN
  (models, ORM)                      |               Resolution:
     Severity:  Normal               |             Triage Stage:  Accepted
     Keywords:  nonrel               |      Needs documentation:  0
    Has patch:  1                    |  Patch needs improvement:  0
  Needs tests:  0                    |                    UI/UX:  0
Easy pickings:  0                    |
-------------------------------------+-------------------------------------

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

--
You received this message because you are subscribed to the Google Groups "Django updates" group.
To post to this group, send email to [hidden email].
To unsubscribe from this group, send email to [hidden email].
For more options, visit this group at http://groups.google.com/group/django-updates?hl=en.

Reply | Threaded
Open this post in threaded view
|

Re: [Django] #17337: [nonrel] Support for non-integer automatic primary keys

Django
In reply to this post by Django
#17337: [nonrel] Support for non-integer automatic primary keys
-------------------------------------+-------------------------------------
     Reporter:  jonash               |                    Owner:  nobody
         Type:  Bug                  |                   Status:  new
    Component:  Database layer       |                  Version:  master
  (models, ORM)                      |               Resolution:
     Severity:  Normal               |             Triage Stage:  Accepted
     Keywords:  nonrel               |      Needs documentation:  0
    Has patch:  1                    |  Patch needs improvement:  1
  Needs tests:  0                    |                    UI/UX:  0
Easy pickings:  0                    |
-------------------------------------+-------------------------------------
Changes (by timo):

 * needs_better_patch:  0 => 1


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

--
You received this message because you are subscribed to the Google Groups "Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/django-updates/064.1fa8fe3112c3f58504f32c12faa5618e%40djangoproject.com.
For more options, visit https://groups.google.com/groups/opt_out.
Reply | Threaded
Open this post in threaded view
|

Re: [Django] #17337: [nonrel] Support for non-integer AutoFields (was: [nonrel] Support for non-integer automatic primary keys)

Django
In reply to this post by Django
#17337: [nonrel] Support for non-integer AutoFields
-------------------------------------+-------------------------------------
     Reporter:  jonash               |                    Owner:  nobody
         Type:  Bug                  |                   Status:  new
    Component:  Database layer       |                  Version:  master
  (models, ORM)                      |
     Severity:  Normal               |               Resolution:
     Keywords:  nonrel               |             Triage Stage:  Accepted
    Has patch:  1                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  1
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------

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

--
You received this message because you are subscribed to the Google Groups "Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/django-updates/064.42dda8ed7f3c783a67a9d149e4f8d870%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: [Django] #17337: [nonrel] Support for non-integer AutoFields

Django
In reply to this post by Django
#17337: [nonrel] Support for non-integer AutoFields
-------------------------------------+-------------------------------------
     Reporter:  Jonas H.             |                    Owner:  nobody
         Type:  Bug                  |                   Status:  new
    Component:  Database layer       |                  Version:  master
  (models, ORM)                      |
     Severity:  Normal               |               Resolution:
     Keywords:  nonrel               |             Triage Stage:  Accepted
    Has patch:  1                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  1
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------

Comment (by Nick Pope):

 This is partially addressed by
 [https://github.com/django/django/pull/10680 PR] for #29979, but will
 further depend on #470 for default values for non-integer fields as well
 as #24042 for replacing `isinstance(..., AutoField)` checks.

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

--
You received this message because you are subscribed to the Google Groups "Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/django-updates/064.3f0ea13e5d59c82d60094d9f96d38c38%40djangoproject.com.
Reply | Threaded
Open this post in threaded view
|

Re: [Django] #17337: [nonrel] Support for non-integer AutoFields

Django
In reply to this post by Django
#17337: [nonrel] Support for non-integer AutoFields
-------------------------------------+-------------------------------------
     Reporter:  Jonas H.             |                    Owner:  nobody
         Type:  Bug                  |                   Status:  new
    Component:  Database layer       |                  Version:  master
  (models, ORM)                      |
     Severity:  Normal               |               Resolution:
     Keywords:  nonrel               |             Triage Stage:  Accepted
    Has patch:  1                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  1
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------

Comment (by Mariusz Felisiak <felisiak.mariusz@…>):

 In [changeset:"21e559495b8255bba1e8a4429cd083246ab90457" 21e5594]:
 {{{
 #!CommitTicketReference repository=""
 revision="21e559495b8255bba1e8a4429cd083246ab90457"
 Fixed #29979, Refs #17337 -- Extracted AutoField field logic into a mixin
 and refactored AutoFields.

 This reduces duplication by allowing AutoField, BigAutoField and
 SmallAutoField to inherit from IntegerField, BigIntegerField and
 SmallIntegerField respectively. Doing so also allows for enabling the
 max_length warning check and minimum/maximum value validation for auto
 fields, as well as providing a mixin that can be used for other possible
 future auto field types such as a theoretical UUIDAutoField.
 }}}

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

--
You received this message because you are subscribed to the Google Groups "Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/django-updates/064.3d96a72a4ec5d7287e2854c6565d2887%40djangoproject.com.