Opened 2 years ago
Closed 2 years ago
#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.
Note:
See TracTickets
for help on using tickets.
Duplicate of #32577.