Commit 7da5c966 authored by Alliyah Marcelo's avatar Alliyah Marcelo

Modified models.py, adding get_absolute_url function in ForumPost model.

parent 34572635
from django.db import models from django.db import models
from django.urls import reverse
class ForumPost(models.Model): class ForumPost(models.Model):
...@@ -19,6 +20,12 @@ class ForumPost(models.Model): ...@@ -19,6 +20,12 @@ class ForumPost(models.Model):
self.body self.body
) )
def get_absolute_url(self):
return reverse(
'forum:forumpost-details',
kwargs={'pk': self.pk}
)
class Reply(models.Model): class Reply(models.Model):
body = models.TextField() body = models.TextField()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment