Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
E
esguerra_lab1
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
James Esguerra
esguerra_lab1
Commits
ab53dd6d
Commit
ab53dd6d
authored
Apr 06, 2021
by
James Esguerra
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added function to display list of keys in key template
parent
19e5e4e9
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
2 deletions
+13
-2
views.cpython-38.pyc
pages/__pycache__/views.cpython-38.pyc
+0
-0
views.py
pages/views.py
+6
-1
key.html
templates/key.html
+7
-1
No files found.
pages/__pycache__/views.cpython-38.pyc
View file @
ab53dd6d
No preview for this file type
pages/views.py
View file @
ab53dd6d
...
@@ -2,6 +2,7 @@ import datetime
...
@@ -2,6 +2,7 @@ import datetime
from
django.shortcuts
import
render
,
redirect
from
django.shortcuts
import
render
,
redirect
from
django.http
import
HttpResponse
from
django.http
import
HttpResponse
from
.forms
import
HomeForm
,
KeyForm
from
.forms
import
HomeForm
,
KeyForm
from
.models
import
Key
def
ShowHome
(
request
):
def
ShowHome
(
request
):
...
@@ -22,7 +23,11 @@ def ShowProfile(request):
...
@@ -22,7 +23,11 @@ def ShowProfile(request):
def
ShowKey
(
request
):
def
ShowKey
(
request
):
return
render
(
request
,
'key.html'
)
key_list
=
Key
.
objects
.
all
()
context
=
{
'key_list'
:
key_list
,
}
return
render
(
request
,
'key.html'
,
context
)
def
ShowAddKey
(
request
):
def
ShowAddKey
(
request
):
...
...
templates/key.html
View file @
ab53dd6d
...
@@ -7,6 +7,12 @@
...
@@ -7,6 +7,12 @@
{% block content %}
{% block content %}
<a
href=
'{% url '
add_key
'
%}'
><button
type=
'button'
>
Add Key
</button></a>
<h3>
Key
&
nbsp Description
</h3>
{% for key in key_list %}
<p>
{{ key.key_name }} {{ key.key_description }}
</p>
{% endfor %}
<a
href=
'{% url '
add_key
'
%}'
><button
type=
'button'
>
Add Key
</button></a>
{% endblock %}
{% endblock %}
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