On Apr 17, 1:14 am, JoJo <culligan.joanne...@gmail.com> wrote:
> Hi all, i have an error here im not sure what it means can anyone help
> me
>
> here is my models.py file##
> class AddStuffForm(forms.Form):
>
>         title = forms.CharField(max_length=100)
>         body = forms.CharField(widget = forms.Textarea())
>
>         def save(self):
>             new_gossip =  Gossip.objects.create(title  =['title'],
>                                                 body =['body'])
>
<snip>

> Exception Type: TypeError at /add_gossip/
> Exception Value: 'body' is an invalid keyword argument for this
> function
>
> Thanks in advance
>

You haven't shown the definition of your Gossip model, but it
apparently doesn't have a `body` field.

Also, not the cause of your error, but you do realise that what you're
trying to do here is set the value of the title and body fields to
'title' and 'body' respectively - although it won't work because
you're wrapping them in lists? Presumably you mean
    title = self.cleaned_data['body']
etc.
--
DR.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

Reply via email to