models/models/analysis.py
def from_db(**kwargs):
        """
        Convert from db keys, mainly converting id to id_
        """
        analysis_type = kwargs.pop('type', None)
        status = kwargs.pop('status', None)
        timestamp_completed = kwargs.pop('timestamp_completed', None)
        meta = kwargs.get('meta')

        if meta and isinstance(meta, str):
            meta = json.loads(meta)

        if timestamp_completed is not None and not isinstance(timestamp_completed, str):
            timestamp_completed = timestamp_completed.isoformat()

        return Analysis(
            id=kwargs.pop('id'),
            type=AnalysisType(analysis_type),
            status=AnalysisStatus(status),
            sample_ids=[kwargs.pop('sample_id')] if 'sample_id' in kwargs else [],
            output=kwargs.pop('output', []),
            timestamp_completed=timestamp_completed,
            project=kwargs.get('project'),
            meta=meta,
            active=bool(kwargs.get('active')),
        )

        Convert from db keys, mainly converting id to id_
        
Convert from db keys, mainly converting id to id_
Convert from db keys mainly converting id to id_
def from_db(**kwargs):
        analysis_type = kwargs.pop('type', None)
        status = kwargs.pop('status', None)
        timestamp_completed = kwargs.pop('timestamp_completed', None)
        meta = kwargs.get('meta')
        if meta and isinstance(meta, str):
            meta = json.loads(meta)
        if timestamp_completed is not None and not isinstance(timestamp_completed, str):
            timestamp_completed = timestamp_completed.isoformat()
        return Analysis(
            id=kwargs.pop('id'),
            type=AnalysisType(analysis_type),
            status=AnalysisStatus(status),
            sample_ids=[kwargs.pop('sample_id')] if 'sample_id' in kwargs else [],
            output=kwargs.pop('output', []),
            timestamp_completed=timestamp_completed,
            project=kwargs.get('project'),
            meta=meta,
            active=bool(kwargs.get('active')),
        )
def from_db ( ** kwargs ) : analysis_type = kwargs . pop ( 'type' , None ) status = kwargs . pop ( 'status' , None ) timestamp_completed = kwargs . pop ( 'timestamp_completed' , None ) meta = kwargs . get ( 'meta' ) if meta and isinstance ( meta , str ) : meta = json . loads ( meta ) if timestamp_completed is not None and not isinstance ( timestamp_completed , str ) : timestamp_completed = timestamp_completed . isoformat ( ) return Analysis ( id = kwargs . pop ( 'id' ) , type = AnalysisType ( analysis_type ) , status = AnalysisStatus ( status ) , sample_ids = [ kwargs . pop ( 'sample_id' ) ] if 'sample_id' in kwargs else [ ] , output = kwargs . pop ( 'output' , [ ] ) , timestamp_completed = timestamp_completed , project = kwargs . get ( 'project' ) , meta = meta , active = bool ( kwargs . get ( 'active' ) ) , )
Convert from db keys, mainly converting id to id_
Convert from db keys mainly converting id to id_
"""
        Convert from db keys, mainly converting id to id_
        """