Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
midterm-group3
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
John Michael T. Amador
midterm-group3
Commits
c38544fa
Commit
c38544fa
authored
May 15, 2023
by
Brendan Fausto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added widgetuser edit page and corresponding template
parent
eea1aff3
Changes
8
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
45 additions
and
2 deletions
+45
-2
models.cpython-311.pyc
widget_group3/dashboard/__pycache__/models.cpython-311.pyc
+0
-0
urls.cpython-311.pyc
widget_group3/dashboard/__pycache__/urls.cpython-311.pyc
+0
-0
views.cpython-311.pyc
widget_group3/dashboard/__pycache__/views.cpython-311.pyc
+0
-0
models.py
widget_group3/dashboard/models.py
+2
-0
widgetuser-details.html
...up3/dashboard/templates/dashboard/widgetuser-details.html
+1
-1
widgetuser-edit.html
...group3/dashboard/templates/dashboard/widgetuser-edit.html
+34
-0
urls.py
widget_group3/dashboard/urls.py
+2
-1
views.py
widget_group3/dashboard/views.py
+6
-0
No files found.
widget_group3/dashboard/__pycache__/models.cpython-311.pyc
View file @
c38544fa
No preview for this file type
widget_group3/dashboard/__pycache__/urls.cpython-311.pyc
View file @
c38544fa
No preview for this file type
widget_group3/dashboard/__pycache__/views.cpython-311.pyc
View file @
c38544fa
No preview for this file type
widget_group3/dashboard/models.py
View file @
c38544fa
...
...
@@ -7,6 +7,8 @@ class Department(models.Model):
dept_name
=
models
.
CharField
(
max_length
=
255
)
home_unit
=
models
.
CharField
(
max_length
=
255
)
def
__str__
(
self
):
return
'{} - {}'
.
format
(
self
.
dept_name
,
self
.
home_unit
)
class
WidgetUser
(
models
.
Model
):
...
...
widget_group3/dashboard/templates/dashboard/widgetuser-details.html
View file @
c38544fa
...
...
@@ -21,7 +21,7 @@
</ul>
<p>
<button
onclick=
"window.location.href='../../../dashboard/widgetusers/{{object.pk}}/edit';"
>
Edit
Activity
</button><br/>
<button
onclick=
"window.location.href='../../../dashboard/widgetusers/{{object.pk}}/edit';"
>
Edit
Widget User
</button><br/>
</p>
{% endblock %}
\ No newline at end of file
widget_group3/dashboard/templates/dashboard/widgetuser-edit.html
0 → 100644
View file @
c38544fa
{% extends 'base.html' %}
{% block title %}
Edit Widget User
{% endblock %}
{% block header %}
<h1>
Edit Widget User:
</h1>
{% endblock %}
{% block content %}
{{ form.non_field_errors }}
{% for field in form %}
{% if field.errors %}
<p>
{{ field.label }} has the following errors:
</p>
<ul>
{% for error in field.errors %}
<li>
{{ error }}
</li>
{% endfor %}
</ul>
{% endif %}
{% endfor %}
<form
method =
"POST"
>
{% csrf_token %}
{{ form.as_p }}
<input
type =
"submit"
value =
"Save Changes to Widget User"
>
</form>
{% endblock %}
\ No newline at end of file
widget_group3/dashboard/urls.py
View file @
c38544fa
...
...
@@ -2,13 +2,14 @@
from
django.urls
import
path
from
.views
import
dashboard
,
WidgetUserCreateView
,
WidgetUserDetailView
from
.views
import
dashboard
,
WidgetUserCreateView
,
WidgetUserDetailView
,
WidgetUserUpdateView
urlpatterns
=
[
path
(
''
,
dashboard
,
name
=
'index'
),
path
(
'widgetusers/add'
,
WidgetUserCreateView
.
as_view
(),
name
=
'widgetuser-add'
),
path
(
'widgetusers/<int:pk>/details'
,
WidgetUserDetailView
.
as_view
(),
name
=
'widgetuser-details'
),
path
(
'widgetusers/<int:pk>/edit'
,
WidgetUserUpdateView
.
as_view
(),
name
=
'widgetuser-edit'
),
]
...
...
widget_group3/dashboard/views.py
View file @
c38544fa
...
...
@@ -25,6 +25,12 @@ class WidgetUserCreateView(CreateView):
template_name
=
'dashboard/widgetuser-add.html'
class
WidgetUserUpdateView
(
UpdateView
):
model
=
WidgetUser
fields
=
'__all__'
template_name
=
'dashboard/widgetuser-edit.html'
class
WidgetUserDetailView
(
DetailView
):
model
=
WidgetUser
template_name
=
'dashboard/widgetuser-details.html'
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment