Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
W
widget_someone here is possessed by an owl
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
Laetitia de Castro
widget_someone here is possessed by an owl
Commits
50c552c3
Commit
50c552c3
authored
May 25, 2022
by
Anya Habana
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Created new user form template
parent
f4f0fa08
Changes
7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
8 additions
and
2 deletions
+8
-2
forms.cpython-38.pyc
homepage/__pycache__/forms.cpython-38.pyc
+0
-0
urls.cpython-38.pyc
homepage/__pycache__/urls.cpython-38.pyc
+0
-0
views.cpython-38.pyc
homepage/__pycache__/views.cpython-38.pyc
+0
-0
forms.py
homepage/forms.py
+1
-1
newuser.html
homepage/templates/users/newuser.html
+6
-0
views.py
homepage/views.py
+1
-1
urls.cpython-38.pyc
widget/__pycache__/urls.cpython-38.pyc
+0
-0
No files found.
homepage/__pycache__/forms.cpython-38.pyc
0 → 100644
View file @
50c552c3
File added
homepage/__pycache__/urls.cpython-38.pyc
View file @
50c552c3
No preview for this file type
homepage/__pycache__/views.cpython-38.pyc
View file @
50c552c3
No preview for this file type
homepage/forms.py
View file @
50c552c3
from
django.forms
import
ModelForm
from
.models
import
WidgetUser
class
WidgetUserForm
(
forms
.
Form
):
class
WidgetUserForm
(
Model
Form
):
class
Meta
:
model
=
WidgetUser
fields
=
[
"first_name"
,
"middle_name"
,
"last_name"
,
"id_num"
,
"email"
,
"department"
]
\ No newline at end of file
homepage/templates/users/newuser.html
0 → 100644
View file @
50c552c3
<form
action=
"{% url 'homepage:newuser' %}"
method=
"POST"
>
{% csrf_token %}
{{ user_form }}
<
<
button
class=
"button"
type=
"submit"
>
Save New User
</button>
</form>
\ No newline at end of file
homepage/views.py
View file @
50c552c3
...
...
@@ -21,7 +21,7 @@ def newuser(request):
return
redirect
(
"homepage:index"
,
pk
=
new_user
.
pk
)
else
:
user_form
=
WidgetUserForm
()
return
render
(
request
,
'newuser.html'
,
{
"user_form"
:
user_form
})
return
render
(
request
,
'
users/
newuser.html'
,
{
"user_form"
:
user_form
})
class
WidgetUserDetailView
(
DetailView
):
model
=
WidgetUser
...
...
widget/__pycache__/urls.cpython-38.pyc
View file @
50c552c3
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