Commit ffb2be43 authored by Stefan Gomez's avatar Stefan Gomez

Implemented the 'Edit Widget User Page'.

parent b6d3d47d
......@@ -7,5 +7,5 @@
<h3>{{ widgetuser.department.home_unit}}</h3>
{% endblock %}
{% block scripts %}
<input type="submit" value="Edit Widget User">
<a href="/dashboard/{{ widgetuser.pk }}/edit"><input type="submit" value="Edit Widget User"></a>
{% endblock %}
\ No newline at end of file
{% extends 'base.html' %}
{% block title %}Edit Widget User{% endblock %}
{% block content %}
<h1>Edit Widget user:</h1>
<form action="" method="post">
{% csrf_token %}
{{ form.as_p }}
<input type="submit" value="Save Changes to Widget User">
</form>
{% endblock %}
{% block scripts %}
{% endblock %}
\ No newline at end of file
from django.contrib import admin
from django.urls import path
from .views import index, WidgetUserDetailView, WidgetUserCreateView
from .views import index, WidgetUserDetailView, WidgetUserCreateView, WidgetUserUpdateView
urlpatterns = [
path('', index, name='index'),
path('<int:pk>/details', WidgetUserDetailView.as_view(), name='widgetuser-details'),
path('add/', WidgetUserCreateView.as_view(), name='add-widgetuser'),
path('<int:pk>/edit', WidgetUserUpdateView.as_view(), name='edit-widgetuser'),
]
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
from django.views.generic.edit import CreateView, UpdateView
from.models import WidgetUser
......@@ -20,3 +20,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