OiO.lk Blog python How to stop auto generating text in ShortUUIDField field
python

How to stop auto generating text in ShortUUIDField field


I have a model where ShortUUIDField automatically generating ids I want to disable the auto generation

class Mymodel(models.Model):
    pid=ShortUUIDField(length=10,max_length=100,prefix="prd",alphabet="abcdef")
    sample_id = ShortUUIDField(length=10, max_length=100, prefix="var", alphabet="abcdef", null=True, blank=True,default=lambda: None) 

I added default=lambda: None in sample_id field but it is still automatically generating the ids. I want the id default to be blank



You need to sign in to view this answers

Exit mobile version