'Replace model instance on Integration subclasses
This is based on the ``integration_type`` field, and is used to provide
specific functionality to and integration via a proxy subclass of the
Integration model.'

def _get_subclass_replacement(self, original):

    cls_replace = self._get_subclass(original.integration_type)
    if (cls_replace is None):
        return original
    new = cls_replace()
    for (k, v) in list(original.__dict__.items()):
        new.__dict__[k] = v
    return new
