docs: def validate(self, data, all_data=None):
          """
          if 'rule' in kwargs, then validate extra rules
  
          e.g.:
              rule= {'required':True, 'minlength':6}
          """
  
          all_data = all_data or {}
  
          if hasattr(data, 'stream'):
              data.file = data.stream
  
          if hasattr(data, 'file'):
              if data.file:
                  v = data.filename
              else:
                  raise Exception, 'Unsupport type %s' % type(data)
          else:
              v = data
  #        if v is None:
  
          msg = TEST_NOT_EMPTY()(v)
          if self.required:
              if msg:
                  return False, msg
          else:
              if msg:
                  return True, self.default
  
          try:
              if isinstance(data, list):
                  v = []
                  for i in data:
                      v.append(self.to_python(i))
                  data = v
              else:
                  data = self.to_python(data)
          except:
              return False, unicode(ERR_CONVERT) % (data, self.__class__.__name__)
          for v in self.get_validators():
              msg = v(data, all_data)
              if msg:
                  return False, msg
          return True, data