@classmethod
def fast_last_trial_id(cls, session=None):
    'Load last trial id that did not bypass modules\n\n\n        Compile SQLAlchemy core query into string for optimization\n\n        Keyword arguments:\n        session -- specify session for loading (default=relational.session)\n        '
    session = (session or relational.session)
    if (not hasattr(cls, '_last_trial_id')):
        ttrial = cls.t
        _query = select([ttrial.c.id]).where(ttrial.c.start.in_(select([func.max(ttrial.c.start)]).select_from(ttrial).where(is_none(ttrial.c.inherited_id))))
        cls.last_trial_id = str(_query)
    an_id = session.execute(cls.last_trial_id).fetchone()
    if (not an_id):
        raise RuntimeError('Not able to bypass modules check because no previous trial was found')
    return an_id[0]
Load last trial id that did not bypass modules


Compile SQLAlchemy core query into string for optimization

Keyword arguments:
session -- specify session for loading (default=relational.session)
@classmethod
def fast_last_trial_id(cls, session=None):
    'Load last trial id that did not bypass modules\n\n\n        Compile SQLAlchemy core query into string for optimization\n\n        Keyword arguments:\n        session -- specify session for loading (default=relational.session)\n        '
    session = (session or relational.session)
    if (not hasattr(cls, '_last_trial_id')):
        ttrial = cls.t
        _query = select([ttrial.c.id]).where(ttrial.c.start.in_(select([func.max(ttrial.c.start)]).select_from(ttrial).where(is_none(ttrial.c.inherited_id))))
        cls.last_trial_id = str(_query)
    an_id = session.execute(cls.last_trial_id).fetchone()
    if (not an_id):
        raise RuntimeError('Not able to bypass modules check because no previous trial was found')
    return an_id[0]