Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Open sidebar
MOOC packages by hacklab
django-courses
Commits
53b2fa81
Commit
53b2fa81
authored
Jul 30, 2019
by
Bruno Martin
Browse files
change __unicode__ to __str__
parent
b61273b2
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
9 deletions
+9
-9
courses/models.py
courses/models.py
+9
-9
No files found.
courses/models.py
View file @
53b2fa81
...
...
@@ -52,7 +52,7 @@ class Class(models.Model):
default
=
False
,
)
def
__
unicode
__
(
self
):
def
__
str
__
(
self
):
return
u
'%s @ %s'
%
(
self
.
name
,
self
.
course
)
def
get_absolute_url
(
self
):
...
...
@@ -222,7 +222,7 @@ class Course(models.Model):
verbose_name
=
_
(
'Course'
)
verbose_name_plural
=
_
(
'Courses'
)
def
__
unicode
__
(
self
):
def
__
str
__
(
self
):
return
self
.
name
@
property
...
...
@@ -391,7 +391,7 @@ class CourseStudent(models.Model):
unique_together
=
((
'user'
,
'course'
),)
ordering
=
[
'course__start_date'
]
def
__
unicode
__
(
self
):
def
__
str
__
(
self
):
return
u
'{0} - {1}'
.
format
(
self
.
course
,
self
.
user
)
def
save
(
self
,
*
args
,
**
kwargs
):
...
...
@@ -600,7 +600,7 @@ class CourseProfessor(models.Model):
verbose_name
=
_
(
'Course Professor'
)
verbose_name_plural
=
_
(
'Course Professors'
)
def
__
unicode
__
(
self
):
def
__
str
__
(
self
):
return
u
'%s @ %s'
%
(
self
.
user
,
self
.
course
)
def
get_name
(
self
):
...
...
@@ -678,7 +678,7 @@ class CourseAuthor(models.Model):
verbose_name_plural
=
_
(
'Course Authors'
)
ordering
=
[
'position'
]
def
__
unicode
__
(
self
):
def
__
str
__
(
self
):
return
u
'%s @ %s'
%
(
self
.
user
,
self
.
course
)
def
get_name
(
self
):
...
...
@@ -837,7 +837,7 @@ class Lesson(PositionedModel):
verbose_name_plural
=
_
(
'Lessons'
)
ordering
=
[
'position'
]
def
__
unicode
__
(
self
):
def
__
str
__
(
self
):
return
self
.
name
@
property
...
...
@@ -914,8 +914,8 @@ class Unit(PositionedModel):
verbose_name_plural
=
_
(
'Units'
)
ordering
=
[
'lesson'
,
'position'
]
def
__
unicode
__
(
self
):
return
u
'%s - %s'
%
(
self
.
title
,
self
.
position
)
def
__
str
__
(
self
):
return
'{} / {} / {} - {}'
.
format
(
self
.
lesson
.
course
.
name
,
self
.
lesson
.
name
,
self
.
title
,
self
.
position
)
class
StudentProgress
(
models
.
Model
):
...
...
@@ -944,7 +944,7 @@ class StudentProgress(models.Model):
unique_together
=
((
'user'
,
'unit'
),)
verbose_name
=
_
(
'Student Progress'
)
def
__
unicode
__
(
self
):
def
__
str
__
(
self
):
return
u
'%s @ %s c: %s la: %s'
%
(
self
.
user
,
self
.
unit
,
self
.
complete
,
self
.
last_access
)
...
...
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