This is driving me nuts.
Here is what I'm getting:
>>> from djangoproject.polls.models import Poll, Choice
>>> Poll.objects.all()
[<Poll: What's up?>, <Poll: What's up?>]
I have no idea why I'm getting <Poll: What's up?> twice. It's a big
problem.
This is the models.py file, that I modified according to the
instructions in the tutorial:
--
[djangoproject]$ cat polls/models.py
import datetime
# Create your models here.
from django.db import models
class Poll(models.Model):
def was_published_today(self):
return self.pub_date.date() == datetime.date.today()
def __str__(self):
return self.question
question = models.CharField(maxlength=200)
pub_date = models.DateTimeField('date published')
class Choice(models.Model):
poll = models.ForeignKey(Poll)
choice = models.CharField(maxlength=200)
votes = models.IntegerField()
--
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---