updated views in accessing templates

parent 38d17e46
...@@ -5,22 +5,22 @@ from .models import Department, WidgetUser ...@@ -5,22 +5,22 @@ from .models import Department, WidgetUser
# dashboard view from .models # dashboard view from .models
def dashboard_view(request): def dashboard_view(request):
users = WidgetUser.objects.all() users = WidgetUser.objects.all()
return render(request, 'dashboard/dashboard.html', {'users': users}) return render(request, 'dashboard.html', {'users': users})
class WidgetUserDetailView(DetailView): class WidgetUserDetailView(DetailView):
model = WidgetUser model = WidgetUser
template_name = "dashboard/widgetuser-details.html" template_name = "widgetuser-details.html"
class WidgetUserCreateView(CreateView): class WidgetUserCreateView(CreateView):
model = WidgetUser model = WidgetUser
template_name = "dashboard/widgetuser-add.html" template_name = "widgetuser-add.html"
fields = "__all__" fields = "__all__"
class WidgetUserUpdateView(UpdateView): class WidgetUserUpdateView(UpdateView):
model = WidgetUser model = WidgetUser
template_name = "dashboard/widgetuser-edit.html" template_name = "widgetuser-edit.html"
fields = "__all__" fields = "__all__"
......
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