python - Set alternative pk in Django -


i make django generate 6+ digits number id's 1 model. don't want start 0 want id's clear , readable users. 1 example: 658975

how that?

i've tried this:

class myuuidmodel(models.model):     id = models.uuidfield(primary_key=true, default=uuid.uuid4, editable=false) 

but uuid generates huge sequences not user-friendly.

do have advices? maybe setting minimum number of autoincrement pk enough.

can't use pk+random number show user , keeping rest of logic same ?

else here go how make primary key start 1000?

write 1 of migration this.


Comments

Popular posts from this blog

ios - Is 'init' forbidden as *part* of a variable name? -

javascript - Why Selenium can't find an element that is graphically visible -

qt - Microsoft FTP Service 451 The parameter is incorrect -