Source

Ochs / poll / models.py

from django.db import models

from news.models import Story

class Poll(models.Model):
    story = models.ForeignKey(Story, blank=True, null=True)
    question = models.TextField()
    pub_date = models.DateTimeField(auto_now=True)

    def __unicode__(self):
        return self.question

class Choice(models.Model):
    poll = models.ForeignKey(Poll)
    choice = models.CharField(max_length=200)
    votes = models.PositiveIntegerField(default=0)

    def __unicode__(self):
        return self.choice