Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Django: Field Error Unknown fields

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)
like image 596
Emile Avatar asked Jul 20 '11 20:07

Emile


1 Answers

Try

    fields = ('message',)

To create a tuple with only one element.

like image 108
S.Lott Avatar answered Nov 10 '22 18:11

S.Lott