﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
24885	Writing your first Django app, part 1 -> def __str__(self): problem or misunderstanding of doc?	TitanFighter	TitanFighter	"Hi guys.
I have a problem with the tutorial ""Writing your first Django app, part 1"" starting from position:
{{{
>>> from polls.models import Question, Choice

# Make sure our __str__() addition worked.
>>> Question.objects.all()
[<Question: What's up?>]

# Django provides a rich database lookup API that's entirely driven by
# keyword arguments.
>>> Question.objects.filter(id=1)
[<Question: What's up?>]
>>> Question.objects.filter(question_text__startswith='What')
[<Question: What's up?>]
}}}

In all cases I receive:
[<Question: Question object>]  instead of [<Question: What's up?>]

I have Ubuntu 15.04_64 and run Python 3.4.3 via ""python3 manage.py shell"", because Ubuntu has built-in Python 2.*

My code is like:
{{{
import datetime

from django.db import models
from django.utils import timezone

class Question(models.Model):
	question_text = models.CharField(max_length=200)
	pub_date = models.DateTimeField('date published')

	def __str__(self):              # __unicode__ on Python 2
		return self.question_text

	def was_published_recently(self):
		return self.pub_date >= timezone.now() - datetime.timedelta(days=1)

class Choice(models.Model):
	question = models.ForeignKey(Question)
	choice_text = models.CharField(max_length=200)
	votes = models.IntegerField(default=0)

	def __str__(self):              # __unicode__ on Python 2
		return self.choice_text
}}}

If something wrong with the code, maybe is it possible to edit this section in tutorial to make it a bit clearer? Or is this problem somewhere else?
Thanks."	Cleanup/optimization	closed	Documentation	1.8	Normal	worksforme	Writing your first Django app, part 1, tutorial,  [<Question: Question object>]		Unreviewed	0	0	0	0	0	0
