ok i did that but now i am getting more errors such as

Traceback:
File "c:\Python26\lib\site-packages\django\core\handlers\base.py" in
get_response
  92.                 response = callback(request, *callback_args,
**callback_kwargs)
File "c:\django\gossip2go\..\gossip2go\applications\views.py" in
add_gossip
  190.             form.save()
File "c:\django\gossip2go\applications\models.py" in save
  135.                                       description
=['description'])
File "c:\Python26\lib\site-packages\django\db\models\manager.py" in
create
  126.         return self.get_query_set().create(**kwargs)
File "c:\Python26\lib\site-packages\django\db\models\query.py" in
create
  314.         obj = self.model(**kwargs)
File "c:\Python26\lib\site-packages\django\db\models\base.py" in
__init__
  323.                 raise TypeError, "'%s' is an invalid keyword
argument for this function" % kwargs.keys()[0]

Exception Type: TypeError at /add_gossip/
Exception Value: 'description' is an invalid keyword argument for this
function

On Apr 16, 11:33 pm, "ge...@aquarianhouse.com"
<ge...@aquarianhouse.com> wrote:
> def save(self):
>    #....
>
> Better:
>  don't overwrite save method
>
> if form.is_valid():
>     form.save()
>
> and you are fine
>
> On Apr 17, 12:30 am, JoJo <culligan.joanne...@gmail.com> wrote:
>
>
>
>
>
> > Hi all, i have created a site where users can leave messages, and
> > their opinions on certain topics, i have the form inserting the data,
> > and i have the data saving but when i refresh the page the data
> > disappears, also when i insert some data into the another text area i
> > am getting an error saying
>
> > Exception Value: save() takes no arguments (1 given)
>
> > Here is my models.py file:
> > class AddGossipNowForm(forms.Form):
> >     title = forms.CharField(max_length=50)
> >     description = forms.CharField(widget = forms.Textarea())
> >     body = forms.Textarea()
>
> >     def save():
> >         new_gossip = Gossip.objects.create(title=['title'],
>
> > description=['description'],
> >                                            body=['body'])
>
> > Here is my views.py file:
> > def add_some_gossip(request):
> >     if request.method == "POST":
> >         form = AddGossipNowForm(data=request.POST)
> >         if form.is_valid():
> >             new_gossip = form.save()
> >             return HttpResponseRedirect("/links/")
> >     else:
> >         form = SignupForm()
> >     return render_to_response('add_some_gossip.html',
> >                                   {'form':form})
>
> > So that is 2 errors that i have, the data will disappear when i
> > refresh and the save function isn't working properly, if anyone could
> > help me it would be great as forms are not my strongest point in
> > Django
> > thanks in advance
>
> > --
> > 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 
> > athttp://groups.google.com/group/django-users?hl=en.
>
> --
> 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 
> athttp://groups.google.com/group/django-users?hl=en.

-- 
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