Example #1
0
def get_implantbyrandomuri(RandomURI):
    c = get_conn().cursor()
    query = convert_query("SELECT * FROM Implants WHERE RandomURI=?")
    c.execute(query, (RandomURI, ))
    result = c.fetchone()
    if result:
        return Implant(result[0], result[1], result[2], result[3], result[4],
                       result[5], result[6], result[7], result[8], result[9],
                       result[10], result[11], result[12], result[13],
                       result[14], result[15], result[16])
    else:
        return None
Example #2
0
def get_implants():
    c = get_conn().cursor()
    c.execute("SELECT * FROM Implants WHERE Alive='Yes' ORDER BY implantid")
    results = c.fetchall()
    implants = []
    for result in results:
        implants.append(
            Implant(result[0], result[1], result[2], result[3], result[4],
                    result[5], result[6], result[7], result[8], result[9],
                    result[10], result[11], result[12], result[13], result[14],
                    result[15], result[16]))
    return implants
Example #3
0
def get_implantbyid(implantId):
    try:
        implantId = int(implantId)
    except ValueError:
        return None
    c = get_conn().cursor()
    query = convert_query("SELECT * FROM Implants WHERE ImplantID=?")
    c.execute(query, (implantId, ))
    result = c.fetchone()
    if result:
        return Implant(result[0], result[1], result[2], result[3], result[4],
                       result[5], result[6], result[7], result[8], result[9],
                       result[10], result[11], result[12], result[13],
                       result[14], result[15], result[16])
    else:
        return None