@classmethod
    def get_related_models(cls, instance):
        relations = [
            (instance.clusters_assoc, 'cluster'),
            (instance.releases_assoc, 'release'),
            (instance.plugins_assoc, 'plugin'),
        ]
        result = []
        for assoc_models, attr in relations:
            for assoc_model in assoc_models:
                related_model = getattr(assoc_model, attr, None)
                result.append({
                    'type': assoc_model.type,
                    'model': related_model})
        return result
Enforces timeouts for idle sessions.
dataset/ETHPy150Open openstack/fuel-web/nailgun/nailgun/objects/deployment_graph.py/DeploymentGraph.get_related_models--crossover with--dataset/ETHPy150Open mollyproject/mollyproject/molly/auth/views.py/SecureView.__call__