(self, field)
为了照顾一图流
为了照顾一图流
为了照顾一图流
def validate_content(self, field):
        """ 为了照顾一图流
        """
        if field.data.find('<img class="upload-topic-image"') == -1 and\
           field.data.find('<embed type="application') == -1:
            data = strip_tags(field.data)
            if len(data) < 3:
                raise ValidationError('内容至少 3 字符')
def validate_content ( self , field ) : if field . data . find ( '<img class="upload-topic-image"' ) == - 1 and field . data . find ( '<embed type="application' ) == - 1 : data = strip_tags ( field . data ) if len ( data ) < 3 : raise ValidationError ( '内容至少 3 字符')