def get_db_version ( session ) : value = session . query ( ProgramInformation . value ) . filter ( ProgramInformation . name == "db_version" ) . scalar ( ) return int ( value )
sqlalchemy python get integer from query result
: param session : actually it is a sqlalchemy session : return : version number
def get_db_version(session):
    """
    :param session: actually it is a sqlalchemy session
    :return: version number
    """
    value = session.query(ProgramInformation.value).filter(ProgramInformation.name == "db_version").scalar()
    return int(value)