Commit 8e52ae09 authored by KaoruSawade's avatar KaoruSawade

implemented editing widget users

parent 88f28423
{% extends 'base.html' %}
{% load static %}
{% block title %}Edit Widget User{% endblock %}
{% block content %}
<h2>Edit Widget user:</h2>
<p>
<form action='' method="POST">
{% csrf_token %}
{{ form.first_name.label_tag }}
{{ form.first_name }}<br><br>
{{ form.middle_name.label_tag }}
{{ form.middle_name }}<br><br>
{{ form.last_name.label_tag }}
{{ form.last_name }}<br><br>
Department, Home Unit:
{{ form.department }}<br><br>
<input type="submit" value="Edit Widget User">
</form>
</p>
{% endblock %}
\ No newline at end of file
from django.urls import path
from .views import WidgetUserDetailView, WidgetUserCreateView
from .views import WidgetUserDetailView, WidgetUserCreateView, WidgetUserUpdateView
from .views import pageview
......@@ -7,6 +7,7 @@ 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'),
path('widgetusers/<int:pk>/edit', WidgetUserUpdateView.as_view(), name='widgetuser-edit'),
]
app_name = "dashboard"
\ No newline at end of file
......@@ -19,3 +19,9 @@ class WidgetUserCreateView(CreateView):
model = WidgetUser
fields = '__all__'
template_name = 'dashboard/widgetuser-add.html'
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