how do we create a custom primary key in django

21 views
Skip to first unread message

chaitak

unread,
Oct 30, 2018, 6:31:48 PM10/30/18
to Django users



                         id = models.CharField(primary_key=True,default='first')
.how can i insert a  custom auto generated primary with the organization name for example 'cha' and  a number starting from 1000 so the final id would be cha1000 and next id would be cha1001



Thanks & Regars
chaitak
Reply all
Reply to author
Forward
0 new messages