python安装django找不到set.up_Django:找不到字段?

我老是出错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

也许我的语法有问题,或者我遗漏了一个明显的基本错误。如果您需要更多信息/背景信息,请告诉我。谢谢您!在

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值