#34938 closed New feature (duplicate)

Allow string based generators for AutoField

Reported by: Gökhan Öztürk Owned by: nobody
Component: Database layer (models, ORM) Version: 5.0
Severity: Normal Keywords: AutoField, string-based-ids
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

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.

Change History (1)

comment:1 by Mariusz Felisiak, 14 months ago

Resolution: duplicate
Status: newclosed

Duplicate of #32577.

Note: See TracTickets for help on using tickets.
Back to Top