def get_status(jid): resp = db(jobs.id==jid).select(jobs.state).first() if resp is None: return 'X' else: return resp.state