Commit 7bbeadb6 authored by KaoruSawade's avatar KaoruSawade

comitting pycache and for pushing updated project-wide files

parent fb7c6344
......@@ -8,7 +8,7 @@
<a href="{{ user.get_absolute_url }}">{{user.last_name}}, {{user.first_name}}</a><br>
{% endfor %}
<br>
<form action='create'>
<form action='dashboard:wid'>
<input type="submit" value="Add Widget User"/>
</form>
<a href="{% url 'announcements:pageview' %}">Announcement Board</a><br>
......
from django.urls import path
from .views import WidgetUserDetailView
from .views import WidgetUserDetailView, WidgetUserCreateView
from .views import pageview
urlpatterns = [
path('dashboard/', pageview, name='pageview'),
path('widgetusers/<int:pk>/details', WidgetUserDetailView.as_view(), name='widgetuser-details'),
path('widgetusers/add', WidgetUserCreateView.as_view(), name='widgetuser-add'),
]
app_name = "dashboard"
\ No newline at end of file
from django.shortcuts import render
from django.views.generic.detail import DetailView
from django.views.generic.edit import CreateView, UpdateView
from .models import Department, WidgetUser
def pageview(request):
......@@ -13,3 +14,8 @@ class WidgetUserDetailView(DetailView):
user = WidgetUser.objects.get(pk=pk)
department = user.department
return render(request, 'dashboard/widgetuser-details.html', {'department': department, 'user': user})
class WidgetUserCreateView(CreateView):
model = WidgetUser
fields = '__all__'
template_name = 'dashboard/widgetuser-add.html'
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