Please show the traceback.

On Friday, December 4, 2015 at 4:30:28 PM UTC-5, Laurent Lc wrote:
>
> Hello,
>
> i try to create my own validator : the goal is to count the number of words
> "app/module/customvalidators.py"
> class COUNT_TEXT(Validator):
>     def __call__(self, value):
>         size = 25
>         error = None
>         try:
>             if len(value.split()) > size:
>                 error="too much words"
>         except:
>             error = "Error counting"
>         return (value, error)
>
> "db.py"
> from customvalidators import COUNT_TEXT
> ..
> ..
> custom_auth_table.abstract.requires=COUNT_TEXT() # this line does not run 
> and create an error  <type 'exceptions.AttributeError'>
>
> Could you help me please
>
> thanks in advance
>
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to