开发者

Django: Field Error Unknown fields

开发者 https://www.devze.com 2023-03-22 00:32 出处:网络
I just installed OS X Lion, so I had to reinstall everything for Python2.7. In doing that I upgraded my Django to 1.3 from 1.2.3. When I try and runserver, I get an odd field error that I\'m having a

I just installed OS X Lion, so I had to reinstall everything for Python2.7. In doing that I upgraded my Django to 1.3 from 1.2.3. When I try and runserver, I get an odd field error that I'm having a tough time deciphering.

FieldError at /
Unknown field(s) (a, m, s, e, g) specified for Note

Here is that Model & Form:

class Note(models.Model):
    pub_date = models.DateTimeField(default=datetime.now, 
        auto_now_add=True, db_index=True)
    user = models.ForeignKey(User, null=True, blank=True, related_name="writers")
    to = models.ForeignKey(User, null=True, blank=True, related_name="tost")
    message = models.CharField(default='', max_length=140)
    active = models.BooleanField(default=True)

class 开发者_运维知识库NoteForm(forms.ModelForm):
    class Meta:
        model = Note
        fields = ('message')

    message = forms.CharField(
        label=_("Sign the Guestbook"),
        widget=forms.Textarea,
        required=True)


Try

    fields = ('message',)

To create a tuple with only one element.

0

精彩评论

暂无评论...
验证码 换一张
取 消