from django.core import meta # Create your models here. class Poll(meta.Model): def __repr__(self): return self.question def was_published_today(self): return self.pub_date.date()==datetime.date.today() fields = ( meta.CharField('question', 'question', maxlength=200), meta.DateTimeField('pub_date', 'date published'), ) class Choice(meta.Model): def __repr__(self): return self.question fields = ( meta.ForeignKey(Poll), meta.CharField('choice', 'choice', maxlength=200), meta.IntegerField('votes', 'votes'), ) ##interpreter output >>> p=polls.get_object(id__exact=1) >>> p.add_choice(choice='Yet another choice', votes=0) Traceback (most recent call last): File "", line 1, in ? AttributeError: 'Poll' object has no attribute 'add_choice'