from django.db import models

class Question(models.Model):
  question_text = models.CharField(max_length=200)
  pub_date = models.DateTimeField('date published')

class Choice(models.Model):
  question = models.ForeignKey(Question)
  choice_text = models.CharField(max_length=200)
  votes = models.IntegerField(default=0)
@@ -1,8 +1,25 @@
+import datetime%0A%0A
 from dja
@@ -38,16 +38,50 @@
 t models
+%0Afrom django.utils import timezone
 %0A%0Aclass 
@@ -208,16 +208,177 @@
 shed')%0A%0A
+  def __str__(self):%0A    return self.question_text%0A%0A  def was_published_recently(self):%0A    return self.pub_date %3E= timezone.now() - datetime.timedelta(days=1)%0A%0A
 class Ch
@@ -487,16 +487,16 @@
 th=200)%0A
-
   votes 
@@ -527,8 +527,58 @@
 fault=0)
+%0A%0A  def __str__(self):%0A    return self.choice_text

edit model for api