Commit c4940daa authored by justin's avatar justin

Modified __str__ of Department model, Implemented views.py logic

parent 475c3419
......@@ -6,7 +6,7 @@ class Department(models.Model):
home_unit = models.CharField(max_length=255)
def __str__(self):
return self.dept_name
return f"{self.dept_name}, {self.home_unit}"
class WidgetUser(models.Model):
......
from django.http import HttpResponse
from .models import Department, WidgetUser
def dashboard(request):
return HttpResponse("test")
content = "Welcome to Widget! <br><br> WIDGET USERS: <br>"
users = WidgetUser.objects.all()
for user in users:
content += str(user) + str(user.department)
return HttpResponse(content)
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