9999 is certainly a valid year. 99 could be a valid calendar month, 
depending on your calendar. You should probably specify what the valid 
range of values are.
Try the IS_MATCH with a regex.

On Tuesday, March 27, 2012 8:05:11 AM UTC-7, Adriano Almeida wrote:
>
> Hi, 
>
> I want a field (may be string,date or number, no prob) to have a 
> format of YYYYMM (valid year and month) or if it is left null, to be 
> 999999. How Could I accomplished that? 
>
> I have tried : 
> Field('A0514_DT_FIN','date',notnull=True, label= 'Dt Fim (YYYYMM)', 
> default= '999999') 
>
> and then the check: 
> db.tb0514_bihc_consultor_nivel.A0514_DT_FIN.requires = 
> IS_EMPTY_OR(IS_DATE(format=T('%Y%m'), error_message='formato deve ser 
> YYYYMM! ou vazio')) 
>
> It does not work as 99 is not a valid month and 9999 is not a valid 
> year. 
>
> Any ideas? 
>
>

Reply via email to