Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
midterm_casanatics
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 Aidan Vincent M. Ng
midterm_casanatics
Commits
11d8cae9
Commit
11d8cae9
authored
May 04, 2023
by
justin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: added forms for user updating
parent
b525594f
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
40 additions
and
11 deletions
+40
-11
urls.cpython-310.pyc
widget_casanatics/dashboard/__pycache__/urls.cpython-310.pyc
+0
-0
views.cpython-310.pyc
...et_casanatics/dashboard/__pycache__/views.cpython-310.pyc
+0
-0
widgetuser-add.html
...anatics/dashboard/templates/dashboard/widgetuser-add.html
+12
-0
widgetuser-details.html
...ics/dashboard/templates/dashboard/widgetuser-details.html
+1
-1
widgetuser-edit.html
...natics/dashboard/templates/dashboard/widgetuser-edit.html
+11
-0
urls.py
widget_casanatics/dashboard/urls.py
+7
-2
views.py
widget_casanatics/dashboard/views.py
+9
-8
db.sqlite3
widget_casanatics/db.sqlite3
+0
-0
No files found.
widget_casanatics/dashboard/__pycache__/urls.cpython-310.pyc
View file @
11d8cae9
No preview for this file type
widget_casanatics/dashboard/__pycache__/views.cpython-310.pyc
View file @
11d8cae9
No preview for this file type
widget_casanatics/dashboard/templates/dashboard/widgetuser-add.html
View file @
11d8cae9
{% extends 'base.html' %}
{% load static %}
{% block title %} Edit User {% endblock %}
{% block content %}
<form
method=
"post"
>
{% csrf_token %}
{{ form.as_p }}
<input
type=
"submit"
value=
"Save Changes"
/>
</form>
Ito ay test!!!
{% endblock %}
widget_casanatics/dashboard/templates/dashboard/widgetuser-details.html
View file @
11d8cae9
...
@@ -8,5 +8,5 @@
...
@@ -8,5 +8,5 @@
<h2>
{{ object.department.dept_name }}
</h2>
<h2>
{{ object.department.dept_name }}
</h2>
<h2>
{{ object.department.home_unit }}
</h2>
<h2>
{{ object.department.home_unit }}
</h2>
</div>
</div>
<a
href=
"./edit"
>
Edit Widget User
</a>
<a
href=
".
.
/edit"
>
Edit Widget User
</a>
{% endblock %}
{% endblock %}
widget_casanatics/dashboard/templates/dashboard/widgetuser-edit.html
View file @
11d8cae9
{% extends 'base.html' %}
{% load static %}
{% block title %} Edit User {% endblock %}
{% block content %}
<form
method=
"post"
>
{% csrf_token %}
{{ form.as_p }}
<input
type=
"submit"
value=
"Save Changes"
/>
</form>
{% endblock %}
widget_casanatics/dashboard/urls.py
View file @
11d8cae9
...
@@ -5,15 +5,20 @@ from . import views
...
@@ -5,15 +5,20 @@ from . import views
urlpatterns
=
[
urlpatterns
=
[
path
(
""
,
views
.
dashboard
,
name
=
"dashboard"
),
path
(
""
,
views
.
dashboard
,
name
=
"dashboard"
),
path
(
path
(
"<int:pk>/details"
,
"<int:pk>/details
/
"
,
views
.
WidgetUserDetailView
.
as_view
(),
views
.
WidgetUserDetailView
.
as_view
(),
name
=
"user-detail"
,
name
=
"user-detail"
,
),
),
path
(
path
(
"add"
,
"add
/
"
,
views
.
WidgetUserDetailView
.
as_view
(),
views
.
WidgetUserDetailView
.
as_view
(),
name
=
"user-add"
,
name
=
"user-add"
,
),
),
path
(
"<int:pk>/edit/"
,
views
.
WidgetUserUpdateView
.
as_view
(),
name
=
"user-edit"
,
),
]
]
...
...
widget_casanatics/dashboard/views.py
View file @
11d8cae9
...
@@ -6,16 +6,13 @@ from django.shortcuts import render
...
@@ -6,16 +6,13 @@ from django.shortcuts import render
def
dashboard
(
request
):
def
dashboard
(
request
):
# content = "Welcome to Widget! <br><br> WIDGET USERS: <br>"
# users = WidgetUser.objects.all()
#
# for user in users:
# content += str(user) + ": " + str(user.department) + "<br>"
#
# return HttpResponse(content)
users
=
WidgetUser
.
objects
.
all
()
users
=
WidgetUser
.
objects
.
all
()
context
=
{
"users"
:
users
}
context
=
{
"users"
:
users
}
return
render
(
request
,
"dashboard/dashboard.html"
,
context
)
return
render
(
request
,
"dashboard/dashboard.html"
,
context
,
)
class
WidgetUserDetailView
(
DetailView
):
class
WidgetUserDetailView
(
DetailView
):
...
@@ -25,7 +22,11 @@ class WidgetUserDetailView(DetailView):
...
@@ -25,7 +22,11 @@ class WidgetUserDetailView(DetailView):
class
WidgetUserUpdateView
(
UpdateView
):
class
WidgetUserUpdateView
(
UpdateView
):
model
=
WidgetUser
model
=
WidgetUser
fields
=
"__all__"
template_name
=
"dashboard/widgetuser-edit.html"
class
WidgetUserCreateView
(
CreateView
):
class
WidgetUserCreateView
(
CreateView
):
model
=
WidgetUser
model
=
WidgetUser
fields
=
"__all__"
template_name
=
"dashboard/widgetuser-add.html"
widget_casanatics/db.sqlite3
View file @
11d8cae9
No preview for this file type
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