Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
W
widget_Alipins
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
Angelico Ruiz T. Teaño
widget_Alipins
Commits
85a1049d
Commit
85a1049d
authored
May 22, 2022
by
Angelico Ruiz T. Teaño
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add redirect link in assignment models after adding new assignment
parent
2ffc327a
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
3 deletions
+5
-3
models.py
widget_alipins/assignments/models.py
+5
-3
No files found.
widget_alipins/assignments/models.py
View file @
85a1049d
from
django.db
import
models
from
django.db
import
models
# Create your models here.
# Create your models here.
class
Course
(
models
.
Model
):
class
Course
(
models
.
Model
):
...
@@ -8,7 +7,7 @@ class Course(models.Model):
...
@@ -8,7 +7,7 @@ class Course(models.Model):
section
=
models
.
CharField
(
max_length
=
3
)
section
=
models
.
CharField
(
max_length
=
3
)
def
__str__
(
self
):
def
__str__
(
self
):
return
self
.
course_code
return
"
%
s |
%
s -
%
s"
%
(
self
.
course_code
,
self
.
course_title
,
self
.
section
)
class
Assignment
(
models
.
Model
):
class
Assignment
(
models
.
Model
):
name
=
models
.
CharField
(
max_length
=
50
)
name
=
models
.
CharField
(
max_length
=
50
)
...
@@ -25,3 +24,6 @@ class Assignment(models.Model):
...
@@ -25,3 +24,6 @@ class Assignment(models.Model):
def
save
(
self
,
*
args
,
**
kwargs
):
def
save
(
self
,
*
args
,
**
kwargs
):
self
.
passing_score
=
int
(
self
.
max_points
*
0.6
)
self
.
passing_score
=
int
(
self
.
max_points
*
0.6
)
return
super
()
.
save
(
*
args
,
**
kwargs
)
return
super
()
.
save
(
*
args
,
**
kwargs
)
def
get_absolute_url
(
self
):
return
u'
%
d/details'
%
self
.
pk
\ No newline at end of file
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