def save(self, *args, **kwargs): self.slug = slugify(self.title) self.content_html = markdown(self.content) super(WikiPage, self).save(*args, **kwargs)
def clean_title(self): if slugify(self.cleaned_data['title']) in ('new', 'list'): raise forms.ValidationError('This title is not allowed.') return self.cleaned_data['title']