Commit 5cd6fc31 authored by Anya Habana's avatar Anya Habana

Added get method to display a Widget User's details

parent b460ec87
......@@ -12,3 +12,14 @@ class WidgetUser(models.Model):
id_num = models.CharField(max_length=7, default="")
email = models.EmailField(default="")
department = models.ForeignKey(Department, on_delete=models.CASCADE, null=True, related_name="users")
def getWidgetUser(self):
return "{}, {} {}: {}, {}, {}, {}<br>".format(
self.last_name,
self.first_name,
self.middle_name,
self.id_num,
self.email,
self.department.dept_name,
self.department.home_unit
)
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