def form_valid(self, form): form.instance.author_user = self.request.user if not self.kwargs['slug']: form.instance.slug = py_slugify(form.instance.name + "-" + rand_slug()) return super().form_valid(form)
def save(self, *args, **kwargs): self.slug = py_slugify(self.name) + "-" + random_slug(3) super(Skill, self).save(*args, **kwargs)
def form_valid(self, form): form.instance.author_user = self.request.user form.instance.slug = py_slugify(form.instance.name + "-" + random_slug(3)) return super().form_valid(form)