>
> Field('id_indra', length=5, label=T('ID Indra'), notnull=False, 
> requires=[REQUIRED, MAX_5, IS_MATCH(r'^[a-zA-Z0-9]{5}$')])
>

What is REQUIRED and MAX_5 -- are those custom validators you created?
 

> Is it is possible to intercept all inserts / updates over this field and 
> do a zfill() before the accion takes place? So, if the field is '5', they 
> it would be completed with zeroes with a result of '00005' before insert / 
> update.
>

You could create a custom 
validator<http://web2py.com/books/default/chapter/29/7#Custom-validators>to do 
this. Validators can be used not only to validate, but also to 
transform the values (e.g, CRYPT, CLEANUP, IS_LOWER, IS_UPPER, IS_SLUG). 
Note, validators are only applied when inserting via form submissions or 
when using the .validate_and_insert() and .validate_and_update() methods.

Anthony

Reply via email to