def insertFullTomoRun(sessiondata, path, runname, method):
    runq = appiondata.ApFullTomogramRunData()
    runq['session'] = sessiondata
    runq['path'] = appiondata.ApPathData(path=os.path.abspath(path))
    runq['runname'] = runname
    runq['method'] = method
    return publish(runq)
def checkExistingFullTomoData(path, name):
    pathq = appiondata.ApPath(path=path)
    runq = appiondata.ApFullTomogramRunData(pathq)
    tomoq = appiondata.ApFullTomogramData(name=name, reconrun=runq)
    results = tomoq.query()
    if not results:
        return None
    filepath = os.path.join(path, name + ".rec")
    if not os.path.isfile(filepath):
        return None
    else:
        return results[0]
def getFullTomoRunById(runid):
    runq = appiondata.ApFullTomogramRunData()
    return runq.direct_query(runid)
def createExcludedColumnByFakeInsert():
    # maketable can not create this column.  Use an insert
    # without other references.
    fakerunq = appiondata.ApFullTomogramRunData()
    fakerunq['excluded'] = [0]
    fakerunq.insert()