rendered paste bodyfrom 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'),
)