Add markdown as dependency to allow casting intent's content to clean

html
This commit is contained in:
Fred 2017-10-19 21:17:43 +02:00
parent 1e6b35bec5
commit d4979a2a57
2 changed files with 6 additions and 0 deletions

View File

@ -1,4 +1,6 @@
from django.db import models
from django.utils.html import mark_safe
from markdown import markdown
class Section(models.Model):
@ -40,6 +42,9 @@ class Intent(models.Model):
return self.content[0:50] + '...'
return None
def get_message_as_markdown(self):
return mark_safe(markdown(self.content, safe_mode='escape'))
class Standard(models.Model):
name = models.CharField(max_length=255)

View File

@ -4,3 +4,4 @@ django-filter==1.0.4
django-simple-history==1.9.0
django-simple-history==1.9.0
pylint
markdown