Thursday, June 30, 2011

Problem with Tutorial 1 - Django Version = 1.3

Greetings!!

In the past few days I have been trying to learn about Django. I
started doing the Tutorial 1. During the tutorial I'm getting a
strange error. I was hoping if someone can help me to understand what
I'm doing wrong and how can I fix it.

This is the code I had:

class Poll(models.Model):
question = models.CharField(max_length=200)
pub_date = models.DateTimeField('date published')
def __unicode__(self):
return self.question

class Choice(models.Model):
poll = models.ForeignKey(Poll)
choice = models.CharField(max_length=200)
votes = models.IntegerField()
def __unicode__(self):
return self.choice

When I execute the command Poll(objetcs.all): I get as result the
following: class [<Poll: Poll object>, <Poll: Poll object>] when I;m
supposed to get as result [<Poll: What's up?>]

I don't know what is missing. If someone can help me I would
appreciate it. Thanks!!


--
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+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

No comments:

Post a Comment