code: def validate_list(self, value):
          
          if len(value) > self.max_items:
              raise ValidationError(
                  u'list must not contain more than {max_items} items.'.format(max_items=self.max_items)
              )
  
          if all(isinstance(item, six.string_types) for item in value) is False:
              raise ValidationError(u'list must only contain strings.')
  
          return value
docs: Validate data before saving to database.
  
          Arguemtns:
              value(list): list to be validated
  
          Returns:
              list if validation is successful
  
          Raises:
              ValidationError