I now have this as the view:
if request.method == 'POST':
form = ContactForm(request.POST)
if form.is_valid():
topic = form.cleaned_data['topic']
message = form.cleaned_data['message']
to = form.cleaned_data.get('to')
sender = form.cleaned_data.get('sender')
send_mail(
'message, topic: %s' % topic,
message, sender,
['to']
)
I need to have to bottom fields to read what is entered into the ' to '
field, I thought something like % to or something would do the trick!?
Cheers,
Rajesh Dhawan wrote:
>
> On Jan 23, 2:39 pm, Andrew Doades <[EMAIL PROTECTED]> wrote:
>
>> I am following the section of the django book
>> (http://www.djangobook.com/en/1.0/chapter07/) to create a feedback form,
>> my problem is when I try to submit the form, I get an error (
>> 'ContactForm' object has no attribute 'clean_data' ) I have read a
>> little and see that it's because the form is not validating? Why is this?
>>
>> What am I doing wrong? ( if anything )
>>
>
> See:
> http://code.djangoproject.com/wiki/BackwardsIncompatibleChanges#Newforms:clean_datachangedtocleaned_data
>
> In short, if you are using a current release of Django, clean_data has
> been renamed to cleaned_data. The book references Django 0.96 and you
> seem to be running a current SVN revision (the SVN revision is
> actually better in numerous ways except for this inconvenience if
> you're following the Book.)
>
> -Rajesh D
> >
>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---