From 2757088859462e39ca2f38579cd759168116af28 Mon Sep 17 00:00:00 2001 From: tkupek Date: Wed, 17 Feb 2016 21:30:03 +0100 Subject: [PATCH] fix for utf-8 in admin backend --- tkupek_elearning/elearning/models.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/tkupek_elearning/elearning/models.py b/tkupek_elearning/elearning/models.py index 736f27e..d8625f7 100644 --- a/tkupek_elearning/elearning/models.py +++ b/tkupek_elearning/elearning/models.py @@ -16,7 +16,7 @@ class Setting(models.Model): logo = models.CharField(max_length=256, null=True) active = models.BooleanField(unique=True, default=False) - def __str__(self): + def __unicode__(self): return self.title @@ -26,16 +26,17 @@ class Question(models.Model): text = models.TextField(null=True) explanation = models.TextField(null=True) - def __str__(self): + def __unicode__(self): return self.title + class Option(models.Model): text = models.CharField(max_length=100, null=True) correct = models.BooleanField(null=False, default=False) question = models.ForeignKey(Question, on_delete=models.CASCADE, null=False) - def __str__(self): + def __unicode__(self): return self.text @@ -49,7 +50,7 @@ class User(models.Model): name = models.CharField(max_length=100, null=False) last_seen = models.DateTimeField(null=True) - def __str__(self): + def __unicode__(self): return self.name @@ -57,7 +58,7 @@ class UserAnswer(models.Model): user = models.ForeignKey(User, on_delete=models.CASCADE, null=False) question = models.ForeignKey(Question, on_delete=models.CASCADE, null=False) - def __str__(self): + def __unicode__(self): return str(self.user) + " - " + str(self.question) class Meta: