Commit 4005cf20 authored by Julia Anishka's avatar Julia Anishka

fixed views format

parent 97e344a2
......@@ -4,11 +4,11 @@ from .models import Department, WidgetUser
class DepartmentAdmin(admin.ModelAdmin):
model = Department
list_display = ("dept_name", "home_unit")
list_display = ('dept_name', 'home_unit')
class WidgetUserAdmin(admin.ModelAdmin):
model = WidgetUser
list_display = ("first_name", "middle_name", "last_name", "department")
list_display = ('first_name', 'middle_name', 'last_name', 'department')
admin.site.register(Department, DepartmentAdmin)
admin.site.register(WidgetUser, WidgetUserAdmin)
\ No newline at end of file
......@@ -6,9 +6,11 @@ from .models import Department, WidgetUser
def index(request):
users = WidgetUser.objects.all()
WelcomeMessage = "Welcome to Widget!<br><br>WIDGET USERS:<br>"
welcomeMessage = 'Welcome to Widget!<br><br>WIDGET USERS:<br>'
widgetusers = ''
for user in users:
WelcomeMessage = WelcomeMessage + user.last_name + ", " + user.first_name + " " + user.middle_name + ": " + user.department.dept_name + ", " + user.department.home_unit + "<br>"
widgetusers += user.last_name + ', ' + user.first_name + ' ' + user.middle_name + ': '
widgetusers += user.department.dept_name + ', ' + user.department.home_unit + '<br>'
return HttpResponse(WelcomeMessage)
\ No newline at end of file
return HttpResponse(welcomeMessage + widgetusers)
\ No newline at end of file
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