Commit 53b2fa81 authored by Bruno Martin's avatar Bruno Martin
Browse files

change __unicode__ to __str__

parent b61273b2
......@@ -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)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment