(cls, deployment_id=None, batch_id=None,
                         target_id=None)
return _Retriever(deployment=deployment, batch=batch, target=target)
workaround to get rid of circular import
workaround to get rid of circular import
workaround to get rid of circular import
def _retrieve_models(cls, deployment_id=None, batch_id=None,
                         target_id=None):
        """ workaround to get rid of circular import """
        from tars.deployment.models import (TarsDeployment, TarsDeploymentBatch,
                                            TarsDeploymentTarget)

        deployment = batch = target = None

        if target_id is not None:
            target = TarsDeploymentTarget.objects.get(id=target_id)
        if batch_id is not None:
            if target is not None:
                batch = target.batch
            else:
                batch = TarsDeploymentBatch.objects.get(id=batch_id)
        if deployment_id is not None:
            if batch is not None:
                deployment = batch.deployment
            elif target is not None:
                deployment = target.batch.deployment
            else:
                deployment = TarsDeployment.objects.get(id=deployment_id)

        return _Retriever(deployment=deployment, batch=batch, target=target)
def _retrieve_models ( cls , deployment_id = None , batch_id = None , target_id = None ) : from tars . deployment . models import ( TarsDeployment , TarsDeploymentBatch , TarsDeploymentTarget ) deployment = batch = target = None if target_id is not None : target = TarsDeploymentTarget . objects . get ( id = target_id ) if batch_id is not None : if target is not None : batch = target . batch else : batch = TarsDeploymentBatch . objects . get ( id = batch_id ) if deployment_id is not None : if batch is not None : deployment = batch . deployment elif target is not None : deployment = target . batch . deployment else : deployment = TarsDeployment . objects . get ( id = deployment_id ) return _Retriever ( deployment = deployment , batch = batch , target = target )