def validate_octal(value):
 if (not value):
  return (None, value)
 try:
  int(value, 8)
  return (None, value)
 except:
  return ((T('%s is not a correct octal value') % value), None)

def validate_octal ( value ) : if ( not value ) : return ( None , value ) try : int ( value , 8 ) return ( None , value ) except : return ( ( T ( '%s is not a correct octal value' ) % value ) , None )
check if string is valid octal number .