Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
W
widget_group3
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
Jonathan Talbot
widget_group3
Commits
36e51a79
Commit
36e51a79
authored
Apr 07, 2022
by
Giancarlo Angelo U. de Torres
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
I have no idea
parent
02082545
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
5 deletions
+10
-5
models.py
widget_group3/widget_group3/models.py
+6
-3
views.py
widget_group3/widget_group3/views.py
+4
-2
No files found.
widget_group3/widget_group3/models.py
View file @
36e51a79
...
@@ -50,13 +50,16 @@ class Assignment(models.Model):
...
@@ -50,13 +50,16 @@ class Assignment(models.Model):
passing_score
=
max_points
*
.6
passing_score
=
max_points
*
.6
def
__str__
(
self
):
def
__str__
(
self
):
return
self
.
name
return
'{} <br> Description: {} <br> Perfect Score: {} <br> Passing Score: {}'
.
format
(
self
.
name
,
self
.
description
,
self
.
max_points
,
self
.
passing_score
)
def
get_absolute_url
(
self
):
def
get_absolute_url
(
self
):
return
reverse
(
'assignment'
,
args
=
[(
self
.
name
)])
return
reverse
(
'assignment'
,
args
=
[(
self
.
full_assignment
)])
class
Course
(
models
.
Model
):
class
Course
(
models
.
Model
):
course_code
=
models
.
CharField
(
max_length
=
10
)
course_code
=
models
.
CharField
(
max_length
=
10
)
course_title
=
models
.
CharField
(
max_length
=
100
)
course_title
=
models
.
CharField
(
max_length
=
100
)
section
=
models
.
CharField
(
max_length
=
3
)
section
=
models
.
CharField
(
max_length
=
3
)
assignment
=
models
.
ForeignKey
(
Assignment
,
)
assignment
=
models
.
ForeignKey
(
Assignment
,
on_delete
=
models
.
CASCADE
)
def
__str__
(
self
):
return
'{} {} {}'
.
format
(
self
.
course_code
,
self
.
course_title
,
self
.
section
)
widget_group3/widget_group3/views.py
View file @
36e51a79
from
django.http
import
HttpResponse
from
django.http
import
HttpResponse
from
.models
import
WidgetUser
,
Forum
,
Announcement
,
Assignment
s
,
from
.models
import
WidgetUser
,
Forum
,
Announcement
,
Assignment
,
Course
def
homepage
(
request
):
def
homepage
(
request
):
return
HttpResponse
(
'Welcome to Widget!'
)
return
HttpResponse
(
'Welcome to Widget!'
)
def
assignments
(
request
):
def
assignments
(
request
):
return
HttpResponse
(
'This is the Assignments page!'
)
assignments
=
Assignment
.
objects
.
all
()
output
=
"Assignments: <br>"
+
"<br>"
.
join
([
str
(
details
)
for
details
in
assignments
])
return
HttpResponse
(
output
,
content_type
=
"text/plain"
)
def
announcements
(
request
):
def
announcements
(
request
):
return
HttpResponse
(
'This is the Announcement Board!'
)
return
HttpResponse
(
'This is the Announcement Board!'
)
...
...
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