Good morning!
I need to validate a field, it is to add phone.

# -*- coding: utf-8 -*-

import tw2.core as twc
from formencode.validators import FieldsMatch, NotEmpty, Email, PlainText, 
PhoneNumber
from formencode.compound import All
import tw2.forms.widgets as twf
from tg import lurl

class LeadForm(twf.Form):
    class child(twf.ListLayout):
        hover_help = True
        name=twf.TextField(label=False,css_class='FormField', placeholder=(
"Nombre*:"), validator=NotEmpty)
        phone=twf.TextField(label=False, css_class='FormField', placeholder
=(u"Teléfono*:"), validator=All(PhoneNumber,NotEmpty))        
        email=twf.TextField(label=False, css_class='FormField', placeholder
=(u"Correo electrónico*:"), validator=All(Email,NotEmpty)) 
        lp_type=twf.HiddenField() 
        event_id=twf.HiddenField() 
        c=twf.HiddenField() 
        m=twf.HiddenField() 
        s=twf.HiddenField()    
    action=lurl('/thanks')
    buttons=[twf.SubmitButton('send',value = u'Enviar Información', 
css_class='FormButton')]
    id = "form"

When I load the page I get the following error

AttributeError: 'function' object has no attribute 'from_python'

-- 
You received this message because you are subscribed to the Google Groups 
"TurboGears" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/turbogears.
For more options, visit https://groups.google.com/d/optout.

Reply via email to