I don't know if its because I'm reading this mail from my phone but
you should have

__unicode__() not _unicode_() ie is 2 underscores before and after not 1

On 4/11/12, Brandy <brandy.norri...@yahoo.com> wrote:
> I am working through the tutorial and have already added the def
> _unicode_ statements to my code. However, when running
> Poll.objects.all(), I still get this output: [<Poll: Poll object>]
>
> Here is the code:
>
> from django.db import models
>
> class Poll(models.Model):
>       question = models.CharField(max_length=200)
>       pub_date = models.DateTimeField('date published')
>       def _unicode_(self):
>               return self.question
> #     def was_published_recently(self):
> #             return self.pub_date >= timezone.now() -
> #datetime.timedelta(days=1)
>
> class Choice(models.Model):
>       poll = models.ForeignKey(Poll)
>       choice = models.CharField(max_length=200)
>       votes = models.IntegerField()
>       def _unicode_(self):
>               return self.choice
>
> Thank you for any help!
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>

-- 
Sent from my mobile device

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

Reply via email to