I just went through the tutorial again to check what the definition of my 
__str__() method was and I noticed where the tutorial says to add a custom 
method to polls/models.py. Before I copied and pasted a whole new object 
and method to the file instead of adding the custom method to the object. 
The next bit works now, hurray. Sorry to ask such a stupid question. Thanks 
a lot for your speedy reply.

On Thursday, June 9, 2016 at 10:03:18 PM UTC+1, ke1g wrote:
>
> What is the definition of your __str__() method?
>
> On Thu, Jun 9, 2016 at 4:11 PM, Neil Hunt <hunt...@gmail.com <javascript:>
> > wrote:
>
>> Hello,
>>
>> I'm enjoying the tutorial and now I'm stuck on the second page (writing 
>> your first Django app part 2), shortly after this paragraph.
>>
>> 'It’s important to add __str__() 
>> <https://docs.djangoproject.com/en/1.9/ref/models/instances/#django.db.models.Model.__str__>
>>  
>> methods to your models, not only for your own convenience when dealing with 
>> the interactive prompt, but also because objects’ representations are used 
>> throughout Django’s automatically-generated admin.'
>>
>> The tutorial says to go into the interactive shell again.
>>
>> This line runs without error.
>>
>> 'from polls.models import Question, Choice'
>>
>> The next line Question.objects.all() results in
>>
>> '[<Question: Question object>]' instead of 
>>
>> '[<Question: What's up?>]'
>>
>> Any help would be much appreciated.
>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to django-users...@googlegroups.com <javascript:>.
>> To post to this group, send email to django...@googlegroups.com 
>> <javascript:>.
>> Visit this group at https://groups.google.com/group/django-users.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/django-users/3154675a-5749-434e-9fce-3aae49014959%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/django-users/3154675a-5749-434e-9fce-3aae49014959%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/6cfb84a1-8483-4d2b-bfbe-b90d990746e3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to