def METHOD_NAME(self, text: str, max_length=50) -> None:
    if not self.slug:
        slug = slugify(text)[: max_length - 5]
        model = type(self)
        if model.objects.filter(slug=slug).exists():
            id = 1
            while model.objects.filter(slug=f"{slug}-{id}").exists():
                id += 1
            slug = f"{slug}-{id}"
        self.slug = slug