1 parent 6a6134b commit 4c695ccCopy full SHA for 4c695cc
1 file changed
bootcamp/qa/models.py
@@ -128,6 +128,9 @@ def get_answers(self):
128
def get_accepted_answer(self):
129
return Answer.objects.get(question=self, is_answer=True)
130
131
+ def get_markdown(self):
132
+ return markdownify(self.content)
133
+
134
135
class Answer(models.Model):
136
"""Model class to contain every answer in the forum and to link it
@@ -150,6 +153,9 @@ class Meta:
150
153
def __str__(self): # pragma: no cover
151
154
return self.content
152
155
156
157
158
159
def count_votes(self):
160
"""Method to update the sum of the total votes. Uses this complex query
161
to avoid race conditions at database level."""
0 commit comments