Commit e340d57b authored by Ysabella Panghulan's avatar Ysabella Panghulan

added get_absolute_url in Event model

parent 90392cb4
from django.db import models from django.db import models
from assignments.models import Course from assignments.models import Course
from django.urls import reverse
# Create your models here. # Create your models here.
class Location(models.Model): class Location(models.Model):
...@@ -24,3 +25,6 @@ class Event(models.Model): ...@@ -24,3 +25,6 @@ class Event(models.Model):
def __str__(self): def __str__(self):
return self.activity return self.activity
def get_absolute_url(self):
return reverse('event-details', kwargs={'pk': self.pk})
\ No newline at end of file
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