created a get absolute url method for WidgetUser objects

parent c801727a
from django.db import models
from django.urls import reverse
# Department
# dept_name; home_unit
......@@ -24,4 +25,7 @@ class WidgetUser(models.Model):
username = self.last_name + ", " + self.first_name + " " + self.middle_name
return username
def get_absolute_url(self):
return (reverse('widgetusers:user-detail', 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