예제 #1
0
    def validate(self, value):
        if not isinstance(value, unicode):
            if not IRichTextData.providedBy(value):
                raise WrongType(value, IRichTextData)

            if self.required:
                if not value.text:
                    raise RequiredMissing()

        return super(RichText, self).validate(value)
예제 #2
0
    def __eq__(self, other):
        if IRichTextData.providedBy(other):
            if (self.format == other.format) and (self.text == other.text):
                return True

        return False