Christopher Arndt wrote:

>Leandro Lucarella schrieb:
>  
>
>>Thanks to both, I could make some progress with those links, but I'm still
>>stucked on my quest to make an identity login form using widgets =/
>>
>>I can't find a way to tell the form to use a 'name' in the submit button.
>>    
>>
>
>Can you read
>
>http://docs.turbogears.org/1.0/SimpleWidgetForm and
>http://docs.turbogears.org/1.0/RoughDocs/FormValidationWithSchemas
>
>and then tell us whether these docs answered your questions or, if not, which
>information you missed or any other criticism, suggestions etc. That would help
>us greatly to imporve the docs.
>
>Cheers, Chris
>
>  
>
This documentation is very, very useful, thank you very much for having 
wrote it.
I have a couple of questions about validators, perhaps you can help me.

first question:

 email = validators.Email(not_empty=True, max=255, strip=True)
I expect that validator strips the field before validate it. I tried a 
definition like this one
and I insert some spaces into the field. I supposed validator considered 
it as an empty field, but...

second question:

class EmailMatchesName(validators.FancyValidator):
    def _to_python(self, value, state):
        name = value.get('name', '').replace(' ', '.')
        email_prefix = value.get('email', '').split('@', 1)[0]
        if email_prefix != name:
            raise validators.Invalid(
                'Email does not conform to naming rules.',
                value, state)
        return value

I tried this validator but it raise the error message at the right side 
of every field in my form.
How to display it only near one filed?

thnak you,
jo









--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"TurboGears" 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/turbogears?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to