Is this a correct way to ensure that slug
will be always unique? Any potential issues?
import uuid
class Item(models.Model):
name = models.CharField(max_length=255)
slug = models.SlugField(max_length=150, unique=True)
def save(self, **kwargs):
if not self.id:
self.slug = uuid.uuid4()
super().save(**kwargs)