[Django] #34938: Allow string based generators for AutoField

4 views
Skip to first unread message

Django

unread,
Oct 30, 2023, 11:00:26 AM10/30/23
to django-...@googlegroups.com
#34938: Allow string based generators for AutoField
-------------------------------------+-------------------------------------
Reporter: Gökhan | Owner: nobody
Öztürk |
Type: New | Status: new
feature |
Component: Database | Version: 5.0
layer (models, ORM) | Keywords: AutoField, string-
Severity: Normal | based-ids
Triage Stage: | Has patch: 0
Unreviewed |
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
-------------------------------------+-------------------------------------
There are other alternative unique identifiers can be used in DB objects.
UUID is not exactly new but can be used. Other alternative ones are `cuid`
and `nanoid`.

Current implementation of `django.db.models.fields.AutoField` is being
extended from `IntegerField`.
I tried to create another Base AutoField that is extending from
`CharField` but there is a guard that checks if custom AutoField is being
extended from `AutoField` or not.

I do not have a clear idea to accomplish this.

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

Django

unread,
Oct 30, 2023, 12:36:16 PM10/30/23
to django-...@googlegroups.com
#34938: Allow string based generators for AutoField
-------------------------------------+-------------------------------------
Reporter: Gökhan Öztürk | Owner: nobody
Type: New feature | Status: closed
Component: Database layer | Version: 5.0
(models, ORM) |
Severity: Normal | Resolution: duplicate
Keywords: AutoField, string- | Triage Stage:
based-ids | Unreviewed
Has patch: 0 | Needs documentation: 0

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

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


Comment:

Duplicate of #32577.

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

Reply all
Reply to author
Forward
0 new messages