Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
midterm_robo_mommy
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
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Raul Jarod Conanan
midterm_robo_mommy
Commits
f00bcb9e
Commit
f00bcb9e
authored
Mar 04, 2023
by
Lance Dominic B. Santuyo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Created the view function for Assignments
parent
8ede546d
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
1 deletion
+17
-1
views.py
widget_robo_mommy/Assignments/views.py
+17
-1
No files found.
widget_robo_mommy/Assignments/views.py
View file @
f00bcb9e
from
django.shortcuts
import
render
from
django.shortcuts
import
render
from
django.http
import
HttpResponse
from
.models
import
Assignment
,
Course
# Create your views here.
def
index
(
request
):
output
=
f
"Widget's Assignments Page
\n
"
count
=
Assignment
.
objects
.
all
()
.
count
()
for
i
in
range
(
1
,
count
+
1
):
assignments
=
Assignment
.
objects
.
get
(
id
=
i
)
courses
=
Course
.
objects
.
get
(
id
=
i
)
output
+=
(
f
"Assignment Name: {assignments.mame}
\n
"
f
"Description: {assignments.description}
\n
"
f
"Perfect Score: {assignments.perfect_score}
\n
"
f
"Passing Score: {assignments.passing_score}
\n
"
f
"Course/Section: {courses.code} {courses.title}-{courses.section}
\n\n
"
)
return
HttpResponse
(
output
)
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