Reverse for 'vote' with arguments '('',)' and keyword arguments '{}' not found.
如图
我选择选项 就没错,因为没触发异常, 当我不选择 的时候提交,就触发了视图异常导致错误 半天没找到错在哪里了, help me . thanks
model:
from django.db import models
import datetime from django.utils import timezone from django.db import models
class track(models.Model): question = models.CharField(max length=200) pub date= models.DateTimeField('date published')
def __unicode__(self):
return self.question
def was_published_recently(self):
now=timezone.now()
return now-datetime.timedelta(days=1) <= self.pub_date < now
was_published_recently.admin_order_field = 'pub_date'
was_published_recently.boolean = True
was_published_recently.short_description = 'Published recently?'
class choice(models.Model): track = models.ForeignKey(track) choice text = models.CharField(max length=200) votes = models.IntegerField(default = 0)
def __unicode__(self):
return self.choice_text
fready
10 years, 7 months ago