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

sequelize.js - Sequelize group by with association includes id -

mongodb - Multiple $and with multiple $or in $match mongoose -

Teradata TPT_INFRA: TPT02640: Error: Conflicting column count -