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
61d22e36
Commit
61d22e36
authored
Mar 04, 2023
by
Lance Dominic B. Santuyo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed model relations in views
parent
6765bbad
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
6 deletions
+8
-6
views.py
widget_robo_mommy/Assignments/views.py
+8
-6
No files found.
widget_robo_mommy/Assignments/views.py
View file @
61d22e36
from
django.shortcuts
import
render
from
django.shortcuts
import
render
from
django.http
import
HttpResponse
from
django.http
import
HttpResponse
from
.models
import
Assignment
,
Course
from
.models
import
Assignment
,
Course
import
os
def
index
(
request
):
def
index
(
request
):
output
=
f
"Widget's Assignments Page
\n
"
output
=
f
"Widget's Assignments Page
<br><br>
"
count
=
Assignment
.
objects
.
all
()
.
count
()
count
=
Assignment
.
objects
.
all
()
.
count
()
for
i
in
range
(
1
,
count
+
1
):
for
i
in
range
(
1
,
count
+
1
):
assignments
=
Assignment
.
objects
.
get
(
id
=
i
)
assignments
=
Assignment
.
objects
.
get
(
id
=
i
)
courses
=
Course
.
objects
.
get
(
id
=
i
)
courses
=
Course
.
objects
.
get
(
id
=
i
)
output
+=
(
f
"Assignment Name: {assignments.name}
\n
"
output
+=
f
"""Assignment Name: {assignments.name}<br>
f
"Description: {assignments.description}
\n
"
Description: {assignments.description}<br>
f
"Perfect Score: {assignments.perfect_score}
\n
"
Perfect Score: {assignments.perfect_score}<br>
f
"Passing Score: {assignments.passing_score}
\n
"
Passing Score: {assignments.passing_score}<br>
f
"Course/Section: {courses.code} {courses.title}-{courses.section}
\n\n
"
)
Course/Section: {assignments.course.code} {assignments.course.title}-{cassignments.course.section}<br>
<br>"""
return
HttpResponse
(
output
)
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