How can I change the field name of Django's autoincrement from id
to something like tablename_id
?
I want to do it in the model definition itself.
The autoincrement key is created automatically do there doesn't seem a way to set it via the db_column
attribute.
class ModelTest(models.Model):
tablename_id = models.AutoField(primary_key=True)
I hope I've helped.