Esempio n. 1
0
def search_thesis_by_id(id):
    conn = get_connection()

    with conn.cursor() as cursor:
        cursor.execute('select * from thesis where id = :id', {'id': id})
        result = dict_mapper(cursor)

        return result
Esempio n. 2
0
def search_faculty_by_email(email):
    conn = get_connection()

    with conn.cursor() as cursor:
        cursor.execute(
            'select * from faculty where upper(email) like upper(:email)',
            {'email': '%' + email + '%'})
        result = dict_mapper(cursor)

        return result
Esempio n. 3
0
def search_faculty_by_name(name):
    conn = get_connection()

    with conn.cursor() as cursor:
        cursor.execute(
            'select * from faculty where upper(name) like upper(:name)',
            {'name': '%' + name + '%'
             })  # needed for capitalizing names, or else search doesn't work
        result = dict_mapper(cursor)
        return result
Esempio n. 4
0
def search_thesis_by_name(name):
    conn = get_connection()

    with conn.cursor() as cursor:
        cursor.execute(
            'select * from thesis where upper(NAME) like upper(:name)',
            {'name': '%' + name + '%'})

        result = dict_mapper(cursor)

        return result
Esempio n. 5
0
def search_faculty_by_phone(phone):
    conn = get_connection()

    with conn.cursor() as cursor:
        cursor.execute(
            'select * from faculty where upper(PHONE) like upper(:phone)',
            {'phone': '%' + phone + '%'})

        result = dict_mapper(cursor)

        return result