When cleaning field, store original value to SourceText model and return rendered field.
        @raise ValidationError when something went wrong with transformation.

def clean(self, value):
        """
        When cleaning field, store original value to SourceText model and return rendered field.
        @raise ValidationError when something went wrong with transformation.
        """
        super_value = super(RichTextField, self).clean(value)

        if super_value in fields.EMPTY_VALUES:
            if self.instance:
                obj_id = self.get_instance_id(self.instance)
                if not obj_id:
                    SourceText.objects.filter(content_type=self.ct, object_id=obj_id, field=self.field_name, processor=self.processor).delete()
                else:
                    SourceText.objects.filter(content_type=self.ct, object_id=obj_id, field=self.field_name).delete()
            self.validate_rendered('')
            return ''

        text = smart_unicode(value)
        if self.instance:
            obj_id = self.get_instance_id(self.instance)
            try:
                if not obj_id:
                    src_text = SourceText(content_type=self.ct, object_id=obj_id, field=self.field_name, processor=self.processor)
                else:
                    src_text = SourceText.objects.get(content_type=self.ct, object_id=obj_id, field=self.field_name)
                assert src_text.processor == self.processor
            except SourceText.DoesNotExist:
                src_text = SourceText(content_type=self.ct, object_id=obj_id, field=self.field_name, processor=self.processor)
            src_text.content = text
            try:
                rendered = src_text.render()
            except ProcessorError, e:
                raise ValidationError(self.error_messages['syntax_error'])
        else:
            # in case of adding new model, instance is not set
            self.instance = src_text = SourceText(
                content_type=self.ct,
                field=self.field_name,
                content=text,
                processor=self.processor
            )
            try:
                rendered = src_text.render()
            except Exception, err:
                raise ValidationError(self.error_messages['syntax_error'])

        self.validate_rendered(rendered)

        if not hasattr(self.model, RICH_FIELDS_SET):
            setattr(self.model, RICH_FIELDS_SET, set())
        getattr(self.model, RICH_FIELDS_SET).add(self.field_name)

        # register the listener that saves the SourceText
        #listener = self.post_save_listener(src_text)
        signals.post_save.connect(receiver=self.post_save_listener, sender=self.model)

        # wrap the text so that we can store the src_text on it
        rendered = UnicodeWrapper(rendered)
        setattr(rendered, self.src_text_attr, src_text)

        return rendered