Auto Create Alpha Numeric ID for Django Model
问题 Just like how Django models automatically create an integer ID for each column entry of a database table, I would like it to automaticallty create an alpha numeric ID as well. The integer can increment, while the character should be cycle through A-Z. 1_A 2_B 3_C . . . 27_A 28_B And so on. Here is my models.py from django.db import models class Sample(models.Model): sample_ID = models.CharField(max_length=20) # Alpha numeric ID described above. sample_name = models.CharField(max_length=30) As