added get absolute url function

parent 0662b273
from django.db import models
from dashboard.models import WidgetUser
from django.urls import reverse
# Announcement
# title; body; author; pub_datetime
......@@ -11,6 +12,9 @@ class Announcement(models.Model):
def __str__(self):
return self.title
def get_absolute_url(self):
return (reverse('announcement_board:announcement_details', kwargs={'pk' : self.pk}))
# Reaction
......@@ -22,3 +26,4 @@ class Reaction(models.Model):
def __str__(self):
return self.name
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