def validate_list(self, value):
        """
        Validate data before saving to database.

        Arguemtns:
            value(list): list to be validated

        Returns:
            list if validation is successful

        Raises:
            ValidationError
        """
        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
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
Validate data before saving to database.

        Arguemtns:
            value(list): list to be validated

        Returns:
            list if validation is successful

        Raises:
            ValidationError