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
5620d77f
Commit
5620d77f
authored
May 12, 2023
by
Lance Dominic B. Santuyo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Removed unnecessary imports and updated the FBV implementation for /assignments/
parent
d3fcdca9
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
18 deletions
+7
-18
views.py
widget_robo_mommy/Assignments/views.py
+7
-18
No files found.
widget_robo_mommy/Assignments/views.py
View file @
5620d77f
from
django.http
import
HttpResponse
from
django.shortcuts
import
render
from
django.views
import
View
from
django.views.generic.list
import
ListView
from
django.views.generic.detail
import
DetailView
from
django.views.generic.edit
import
CreateView
,
UpdateView
from
.models
import
Assignment
,
Course
from
.forms
import
AssignmentForm
,
CourseForm
from
.models
import
Assignment
from
.forms
import
AssignmentForm
class
AssignmentDetailsView
(
DetailView
):
...
...
@@ -27,16 +24,8 @@ class EditAssignmentView(UpdateView):
def
index
(
request
):
output
=
f
"Widget's assignments Page<br><br>"
count
=
Assignment
.
objects
.
all
()
.
count
()
for
i
in
range
(
1
,
count
+
1
):
assignments
=
Assignment
.
objects
.
get
(
id
=
i
)
output
+=
f
"""Assignment Name: {assignments.name}<br>
Description: {assignments.description}<br>
Perfect Score: {assignments.perfect_score}<br>
Passing Score: {assignments.passing_score}<br>
Course/Section: {assignments.course.code} {assignments.course.title}-{assignments.course.section}<br>
<br>"""
return
HttpResponse
(
output
)
assignments
=
Assignment
.
objects
.
all
()
context
=
{
'assignments'
:
assignments
}
return
render
(
request
,
'assignments/assignments.html'
,
context
)
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