Commit 88f28423 authored by KaoruSawade's avatar KaoruSawade

implemented adding widget users

parent 7bbeadb6
from django import forms
from .models import WidgetUser
class WidgetUserForm(forms.ModelForm):
class Meta:
model = WidgetUser
fields = ['first_name', 'middle_name', 'last_name', 'department',]
\ No newline at end of file
...@@ -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='dashboard:wid'> <form action={% url 'dashboard:widgetuser-add' %}>
<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>
......
{% extends 'base.html' %}
{% load static %}
{% block title %}Add Widget User{% endblock %}
{% block content %}
<h2>Add a new 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="Add Widget User">
</form>
</p>
{% endblock %}
\ 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