Changed full_name function in WidgetUser model to __str__

parent d8a574ab
......@@ -19,8 +19,7 @@ class WidgetUser(models.Model):
department = models.ForeignKey(Department, on_delete = models.CASCADE)
@property
def full_name(self):
def __str__(self):
return '{}, {} {}'.format(self.last_name, self.first_name, self.middle_name)
@property
......@@ -30,4 +29,4 @@ class WidgetUser(models.Model):
@property
def user_info(self):
return '<br>{}: {}, {}, {}'.format(self.full_name, self.id_num, self.email, self.department.dept_info)
\ No newline at end of file
return '<br>{}: {}, {}, {}'.format(self.__str__, self.id_num, self.email, self.department.dept_info)
\ No newline at end of file
from django.shortcuts import render
from django.http import HttpResponse
from .models import WidgetUser
......
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