def render(self, commit=False): self.body_html = markup(self.body, obj=self) # Remove tags which was generated with the markup processor text = strip_tags(self.body_html) # Unescape entities which was generated with the markup processor self.body_text = unescape(text) if commit: update_fields(self, fields=('body_html', 'body_text', ))
def save(self, *args, **kwargs): self.signature = markup(self.signature, obj=self) super(Profile, self).save(*args, **kwargs)