src/reversion/models.py
def cached_instances(self):
        """
        Return and cache instance with its parents
        """

        obj = self.object_version.object
        result = [obj]
        for parent_class in obj._meta.get_parent_list():
            content_type = ContentType.objects.get_for_model(parent_class)
            parent_id = obj.pk
            try:
                parent_version = Version.objects.get(revision__id=self.revision_id,
                                                     content_type=content_type,
                                                     object_id=parent_id)
            except Version.DoesNotExist:
                pass
            else:
                result.append(parent_version.object_version.object)
        return result

        Return and cache instance with its parents
        
Return and cache instance with its parents
Return and cache instance with its parents
def cached_instances(self):
        obj = self.object_version.object
        result = [obj]
        for parent_class in obj._meta.get_parent_list():
            content_type = ContentType.objects.get_for_model(parent_class)
            parent_id = obj.pk
            try:
                parent_version = Version.objects.get(revision__id=self.revision_id,
                                                     content_type=content_type,
                                                     object_id=parent_id)
            except Version.DoesNotExist:
                pass
            else:
                result.append(parent_version.object_version.object)
        return result
def cached_instances ( self ) : obj = self . object_version . object result = [ obj ] for parent_class in obj . _meta . get_parent_list ( ) : content_type = ContentType . objects . get_for_model ( parent_class ) parent_id = obj . pk try : parent_version = Version . objects . get ( revision__id = self . revision_id , content_type = content_type , object_id = parent_id ) except Version . DoesNotExist : pass else : result . append ( parent_version . object_version . object ) return result
Return and cache instance with its parents
Return and cache instance with its parents
"""
        Return and cache instance with its parents
        """
self