--
You received this message because you are subscribed to the Google Groups "Django users" group.
To post to this group, send email to django...@googlegroups.com.
To unsubscribe from this group, send email to django-users...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
My wild guess is that you're returning an instance of ContactForm in one of your views. A view should return an HttpResponse object. Check your view that uses this form
On Sat, May 12, 2012 at 8:21 PM, django-user59 wrote:
Hi,
I could not get the Chapter 7 "contact" form example to work. The
public copy-paste is here: http://dpaste.com/747112/copy/
The message I get is:
AttributeError at /contact/
'ContactForm' object has no attribute 'status_code'
My ContactForm definition is as follows:
from django import forms
class ContactForm(forms.Form):
subject = forms.CharField(max_length=100)
email = forms.EmailField(required=False, label='Your e-mail
address')
message = forms.CharField(widget=forms.Textarea)
def clean_message(self):
message = self.cleaned_data['message']
num_words = len(message.split())
if num_words < 4:
raise forms.ValidationError("Not enough words!")
return message
--
You received this message because you are subscribed to the Google Groups "Django users" group.
To post to this group, send email to django...@googlegroups.com.
To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
To view this discussion on the web visit https://groups.google.com/d/msg/django-users/-/IKBfOVtf7m0J.
To unsubscribe from this group, send email to django-users...@googlegroups.com.