Re: __unicode__() addition not working in basic poll application.
Thanks for the advice. It's true that I'm just learning django, and because I wanted to use python3, I installed via the most up-to-date development source code. My experience with development versions of stuff has actually been better than the fully supported versions of the same product for some reason. So, I'll be continuing on this path. It's strange that people were experiencing this error over a year ago and didn't mention if they were using python3. Anyone searching on this error in the future will be glad to see the correct answer here if they are using python3.
On Monday, May 16, 2011 7:32:41 AM UTC-5, maaz muqri wrote:
Hi,--
____________________________________
class Poll(models.Model):
# ...
def __unicode__(self):
return self.question
class Choice(models.Model):
# ...
def __unicode__(self):
return self.choice
____________________________________
after adding the above code also I am not able to retrieve the
question by the command:
I am getting this
>>>Poll.objects.all()
[<Poll: Poll object>]
instead of this
>>>Poll.objects.all()
[<Poll: What's up?>]
You received this message because you are subscribed to the Google Groups "Django users" group.
To view this discussion on the web visit https://groups.google.com/d/msg/django-users/-/IjcpjmcL2PQJ.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home