Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
W
widget_tee jays angelos
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
Ramon Angelo Enriquez
widget_tee jays angelos
Commits
2bbb6db1
Commit
2bbb6db1
authored
May 25, 2022
by
Paul Angelo Sy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Converted view to class based for assignments
parent
8a0f68f2
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
13 additions
and
10 deletions
+13
-10
urls.cpython-310.pyc
...jays_angelos/assignments/__pycache__/urls.cpython-310.pyc
+0
-0
urls.py
widget_tee_jays_angelos/assignments/urls.py
+2
-1
views.py
widget_tee_jays_angelos/assignments/views.py
+11
-9
models.cpython-310.pyc
...tee_jays_angelos/forum/__pycache__/models.cpython-310.pyc
+0
-0
views.cpython-310.pyc
..._tee_jays_angelos/forum/__pycache__/views.cpython-310.pyc
+0
-0
No files found.
widget_tee_jays_angelos/assignments/__pycache__/urls.cpython-310.pyc
View file @
2bbb6db1
No preview for this file type
widget_tee_jays_angelos/assignments/urls.py
View file @
2bbb6db1
from
django.urls
import
path
from
django.urls
import
path
from
django.conf.urls.static
import
static
from
django.conf.urls.static
import
static
from
.
import
views
from
.
import
views
from
.views
import
AssignmentView
app_name
=
"assignments"
app_name
=
"assignments"
urlpatterns
=
[
urlpatterns
=
[
path
(
''
,
views
.
index
,
name
=
"assignments"
),
path
(
''
,
AssignmentView
.
as_view
()
,
name
=
"assignments"
),
path
(
"<int:assignment_id>/details"
,
views
.
detail
,
name
=
"details"
),
path
(
"<int:assignment_id>/details"
,
views
.
detail
,
name
=
"details"
),
path
(
'newAssignment'
,
views
.
newAssignment
,
name
=
"newAssignment"
)
path
(
'newAssignment'
,
views
.
newAssignment
,
name
=
"newAssignment"
)
]
]
widget_tee_jays_angelos/assignments/views.py
View file @
2bbb6db1
...
@@ -3,17 +3,19 @@ from assignments.models import Assignment, Course
...
@@ -3,17 +3,19 @@ from assignments.models import Assignment, Course
from
django.shortcuts
import
render
,
redirect
from
django.shortcuts
import
render
,
redirect
from
django.template
import
loader
from
django.template
import
loader
from
.forms
import
AssignmentForm
from
.forms
import
AssignmentForm
from
django.views
import
View
# Create your views here.
# Create your views here.
def
index
(
request
):
class
AssignmentView
(
View
):
def
get
(
self
,
request
):
course_list
=
Course
.
objects
.
order_by
(
"course_code"
)
course_list
=
Course
.
objects
.
order_by
(
"course_code"
)
assignment_list
=
Assignment
.
objects
.
all
()
assignment_list
=
Assignment
.
objects
.
all
()
template
=
loader
.
get_template
(
"assignments/index.html"
)
#
template = loader.get_template("assignments/index.html")
context
=
{
context
=
{
"course_list"
:
course_list
,
"course_list"
:
course_list
,
"assignment_list"
:
assignment_list
"assignment_list"
:
assignment_list
}
}
return
HttpResponse
(
template
.
render
(
context
,
request
)
)
return
render
(
request
,
"assignments/index.html"
,
context
)
def
detail
(
request
,
assignment_id
):
def
detail
(
request
,
assignment_id
):
try
:
try
:
...
...
widget_tee_jays_angelos/forum/__pycache__/models.cpython-310.pyc
View file @
2bbb6db1
No preview for this file type
widget_tee_jays_angelos/forum/__pycache__/views.cpython-310.pyc
View file @
2bbb6db1
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