final fix for unicode error with users

This commit is contained in:
tkupek 2016-03-19 19:42:57 +01:00
parent e1d365f408
commit ce0637f65c
3 changed files with 5 additions and 2 deletions

View file

@ -16,4 +16,7 @@
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_6" default="false" assert-keyword="true" jdk-15="true" project-jdk-name="Python 2.7.6 (/usr/bin/python2.7)" project-jdk-type="Python SDK"> <component name="ProjectRootManager" version="2" languageLevel="JDK_1_6" default="false" assert-keyword="true" jdk-15="true" project-jdk-name="Python 2.7.6 (/usr/bin/python2.7)" project-jdk-type="Python SDK">
<output url="file://$PROJECT_DIR$/out" /> <output url="file://$PROJECT_DIR$/out" />
</component> </component>
<component name="PythonCompatibilityInspectionAdvertiser">
<option name="version" value="1" />
</component>
</project> </project>

Binary file not shown.

View file

@ -78,7 +78,7 @@ class UserAnswer(models.Model):
correct = models.NullBooleanField(null=True) correct = models.NullBooleanField(null=True)
def __unicode__(self): def __unicode__(self):
return str(self.user) + " - " + str(self.question.id) return self.user.name + " - " + str(self.question.id)
class Meta: class Meta:
unique_together = (('user', 'question'),) unique_together = (('user', 'question'),)
@ -92,4 +92,4 @@ class UserAnswerOptions(models.Model):
unique_together = (('user_answer', 'option'),) unique_together = (('user_answer', 'option'),)
def __unicode__(self): def __unicode__(self):
return str(self.user_answer) + " - " + str(self.option) return self.user_answer + " - " + self.option