"e-mail" can't have a hyphen in it. Python thinks you're "assigning" to the operation e - mail
just type into a shell to see. e-mail = "blah" SyntaxError: can't assign to operator rename to e_mail or email or something and you should be good to go On 22 July 2010 06:10, strayhand <tobyb...@gmail.com> wrote: > I apologize in advance if i'm posting this question in the wrong area. > I'm learning about django's form class in "The Definitive Guide To > Django" and for some reason that's beyond me I keep getting a syntax > error. I've been over my code a dozen times and I'm hoping that > someone can point me in the right direction. > > (Taken from page 133-134) > > contactforms.py > > from django import forms > > class ContactForm(forms.Form): > subject = forms.CharField() > e-mail = forms.EmailField(required=False) > message = forms.CharField() > > When I jump into the shell and type the following I get the syntax > error: > > from contactforms import ContactForms > Traceback (most recent call last): > File "<console>", line 1, in <module> > File "/Users/bealtr/Personal/YLBBQ/Django Projects/ylbbq/ > contactforms.py", line 5 > e-mail = forms.EmailField(required=False) > SyntaxError: can't assign to operator > > What am I doing wrong? > > -- > 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. > > -- 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.