from django.db import models


class Poll(models.Model):
    question = models.CharField(max_length=255)

class Choice(models.Model):
    poll = models.ForeignKey(Poll)
    choice = models.CharField(max_length=255)

from django.db import models


class Poll(models.Model):
    question = models.CharField(max_length=255)

    def __unicode__(self):
        return self.question

class Choice(models.Model):
    poll = models.ForeignKey(Poll)
    choice = models.CharField(max_length=255)

    def __unicode__(self):
        return self.choice

add unicode function to poll and choice models