|
11 | 11 | from slugify import slugify |
12 | 12 |
|
13 | 13 | from taggit.managers import TaggableManager |
| 14 | +from markdownx.models import MarkdownxField |
| 15 | +from markdownx.utils import markdownify |
14 | 16 |
|
15 | 17 |
|
16 | 18 | class Vote(models.Model): |
@@ -79,7 +81,7 @@ class Question(models.Model): |
79 | 81 | timestamp = models.DateTimeField(auto_now_add=True) |
80 | 82 | slug = models.SlugField(max_length=80, null=True, blank=True) |
81 | 83 | status = models.CharField(max_length=1, choices=STATUS, default=DRAFT) |
82 | | - content = models.TextField(max_length=2500) |
| 84 | + content = MarkdownxField() |
83 | 85 | has_answer = models.BooleanField(default=False) |
84 | 86 | total_votes = models.IntegerField(default=0) |
85 | 87 | votes = GenericRelation(Vote) |
@@ -132,7 +134,7 @@ class Answer(models.Model): |
132 | 134 | to its respective question.""" |
133 | 135 | question = models.ForeignKey(Question, on_delete=models.CASCADE) |
134 | 136 | user = models.ForeignKey(settings.AUTH_USER_MODEL, on_delete=models.CASCADE) |
135 | | - content = models.TextField(max_length=2500) |
| 137 | + content = MarkdownxField() |
136 | 138 | uuid_id = models.UUIDField( |
137 | 139 | primary_key=True, default=uuid.uuid4, editable=False) |
138 | 140 | total_votes = models.IntegerField(default=0) |
|
0 commit comments