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 assignments.models import Course
from django.urls import reverse
# Create your models here.
class Location(models.Model):
......@@ -23,4 +24,7 @@ class Event(models.Model):
course = models.ForeignKey(Course, on_delete = models.CASCADE)
def __str__(self):
return self.activity
\ No newline at end of file
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