我老是出错ImproperlyConfigured at /messages/compose/
Creating a ModelForm without either the 'fields' attribute or the 'exclude' attribute is prohibited; form ComposeForm needs updating.
我完全理解错误指出了什么,但我不明白为什么它首先出现?在
这是django要我更新的表格:
^{pr2}$
这是我的模型(带字段):from django.db import models
from django.contrib.auth.models import User
# Create your models here.
user_obj = User.objects.get(username = 'jess')
class DirectMessage(models.Model):
subject = models.CharField(max_length =150)
body = models.CharField(max_length =3000)
sender = models.ForeignKey(User, related_name='sent_direct_messages', null=True, blank=True)
receiver = models.ForeignKey(User, related_name='recieved_direct_messages', null=True, blank=True)
sent = models.DateTimeField(auto_now_add=False, auto_now=False, null=True, blank=True)
read = models.DateTimeField(auto_now_add=False, auto_now=False, null=True, blank=True)
def __unicode__(self):
return self.subject
也许我的语法有问题,或者我遗漏了一个明显的基本错误。如果您需要更多信息/背景信息,请告诉我。谢谢您!在