Add abstract model for uuid field
import uuid
class UUidModel(models.Model):
uid = models.UUIDField(default=uuid.uuid4, editable=False)
class Meta:
abstract = True
def save(self, *args, **kwargs):
if not self.pk:
self.uid = uuid.uuid4()
super().save(*args, **kwargs)