Problem with __unicode__ in your tutorial
|Reported by:||petergoldsborough@…||Owned by:||nobody|
|Severity:||Normal||Keywords:||unicode, tutorial, python 3.2|
|Cc:||Triage Stage:||Ready for checkin|
|Has patch:||yes||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
After having awaited Django 1.5 for a long time, I immediately wanted to start to learn how to use it. For this, I'm using your official tutorial on djangoproject.com. Unfortunately I encountered difficulties with unicode on page 1 of your tutorial.
After having followed your instructions I had the problem that even though I incorporated the unicode function in my models.py file, Poll.objects.all() would still only show me [(Poll: Poll Object)] instead of showing my question. After spending a lot of time figuring out the problem, in the process even opening up a hole new project, I, today, more or less by accident tried out putting str instead of unicode in the function and miraculously it worked and I got [(Poll: "What's up?")] whereas with unicode I didn't.
I don't know what you can make of this as I'm not an expert (yet). I just thought I would share my discovery with you.
Kind regards and keep up the great work,
Change History (9)
comment:1 Changed 2 years ago by timo
- Needs documentation unset
- Needs tests unset
- Patch needs improvement unset
comment:4 Changed 2 years ago by aaugustin
- Component changed from Uncategorized to Documentation
- Easy pickings set
- Has patch set
- Triage Stage changed from Accepted to Ready for checkin
comment:5 Changed 2 years ago by Tim Graham <timograham@…>
- Resolution set to fixed
- Status changed from new to closed