Commit 6557d760 authored by RJC's avatar RJC

modified user model to display in format: last_name, first_name

parent 5923066b
...@@ -16,6 +16,9 @@ class WidgetUser(models.Model): ...@@ -16,6 +16,9 @@ class WidgetUser(models.Model):
last_name = models.CharField(max_length=50) last_name = models.CharField(max_length=50)
department = models.ForeignKey(Department, related_name="department", on_delete=models.CASCADE) department = models.ForeignKey(Department, related_name="department", on_delete=models.CASCADE)
def __str__(self) -> str:
return str(self.last_name + ', ' + self.first_name)
def get_absolute_url(self): def get_absolute_url(self):
return reverse('widgetuser-detail', kwargs={'pk': self.pk}) return reverse('widgetuser-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