Removed commented code in views.py of the dashboard app

parent 5940d495
from django.shortcuts import render from django.shortcuts import render
from django.http import HttpResponse from django.http import HttpResponse
from django.views.generic.detail import DetailView
from django.views.generic.edit import CreateView, UpdateView
from .models import Department, WidgetUser from .models import Department, WidgetUser
def dashboard(request): def dashboard(request):
widgetusers = WidgetUser.objects.all() return render(request, 'dashboard/dashboard.html', {'WidgetUser': WidgetUser.objects.all()})
response = "Welcome to Widget!<br><br>WIDGET USERS:<br>"
for user in widgetusers: class WidgetuserDetailView(DetailView):
response += "{}, {} {}: {}, {}<br>".format( model = WidgetUser
user.last_name, template_name ='dashboard/widgetuser-details.html'
user.first_name, fields = '__all__'
user.middle_name,
user.department,
user.department.home_unit class WidgetuserCreateView(CreateView):
) model = WidgetUser
fields = '__all__'
return HttpResponse(response) template_name ='dashboard/widgetuser-add.html'
\ No newline at end of file
class WidgetuserUpdateView(UpdateView):
model = WidgetUser
fields = '__all__'
template_name ='dashboard/widgetuser-edit.html'
\ 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