Commit 7bbeadb6 authored by KaoruSawade's avatar KaoruSawade

comitting pycache and for pushing updated project-wide files

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