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)
def __eq__(self, other): if IRichTextData.providedBy(other): if (self.format == other.format) and (self.text == other.text): return True return False