'Ensure that parent_id identifies a comment that is actually in the
thread identified by thread_id and does not violate the configured
maximum depth.'

def validate(self, attrs):

    parent = None
    parent_id = attrs.get('parent_id')
    if parent_id:
        try:
            parent = Comment(id=parent_id).retrieve()
        except CommentClientRequestError:
            pass
        if (not (parent and (parent['thread_id'] == attrs['thread_id']))):
            raise ValidationError('parent_id    does    not    identify    a    comment    in    the    thread    identified    by    thread_id.')
    if is_comment_too_deep(parent):
        raise ValidationError({'parent_id': ['Comment    level    is    too    deep.']})
    return attrs
