Added get_absolute_url and get_update_url

parent 069da209
from django.db import models from django.db import models
from django.urls import reverse
class Department(models.Model): class Department(models.Model):
...@@ -17,3 +18,10 @@ class WidgetUser(models.Model): ...@@ -17,3 +18,10 @@ class WidgetUser(models.Model):
def __str__(self): def __str__(self):
return '{}, {} {} : {}'.format(self.last_name, self.first_name, self.middle_name, self.department) return '{}, {} {} : {}'.format(self.last_name, self.first_name, self.middle_name, self.department)
def get_absolute_url(self):
return reverse('dashboard:widgetuser-details', kwargs={'pk': self.pk})
def get_update_url(self):
return reverse('dashboard:widgetuser-edit', kwargs={'pk': self.pk})
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