Commit 43a70fc3 authored by Jan Enzo Salvador's avatar Jan Enzo Salvador

Added get_absolute_url function

parent b115622d
from django.db import models from django.db import models
from dashboard.models import WidgetUser from dashboard.models import WidgetUser
from django.urls import reverse
# Forum Post # Forum Post
# title; body; author; pub_datetime; # title; body; author; pub_datetime;
...@@ -11,6 +12,9 @@ class ForumPost(models.Model): ...@@ -11,6 +12,9 @@ class ForumPost(models.Model):
def __str__(self): def __str__(self):
return self.title return self.title
def get_absolute_url(self):
return reverse('forumpost-details', kwargs={'pk':self.pk})
# Reply # Reply
# body; author; pub_datetime; forum_post; # body; author; pub_datetime; forum_post;
......
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