Exemplo n.º 1
0
def get_users_for_bi_man(id_user):
    array = [id_user]
    sql = 'SELECT * FROM users WHERE id != ? AND activation = 1 AND (gender = "Male" AND (sex_pref = "Homosexual" OR sex_pref = "Bisexual")) OR (gender = "Female" AND (sex_pref = "Heterosexual" OR sex_pref = "Bisexual"))'
    res = database.db_query(sql, array)
    return res
Exemplo n.º 2
0
def get_homo_or_bi_women(id_user):
    array = [id_user]
    sql = 'SELECT * FROM users WHERE id != ? AND activation = 1 AND gender = "Female" AND (sex_pref = "Homosexual" OR sex_pref = "Bisexual")'
    res = database.db_query(sql, array)
    return res
Exemplo n.º 3
0
def search_with_geolocation(id_user):
    array = [id_user]
    sql = 'SELECT * FROM users INNER JOIN geolocation ON users.id = geolocation.id_user WHERE users.activation = 1 AND users.id != ?'
    res = database.db_query(sql, array)
    return res
Exemplo n.º 4
0
def search_by_last_name(id_user, last_name):
    array = [last_name, id_user]
    sql = 'SELECT * FROM users WHERE lastname LIKE "%"||?||"%" AND id != ? AND activation = 1'
    res = database.db_query(sql, array)
    return res
Exemplo n.º 5
0
def search(id_user):
    array = [id_user]
    sql = 'SELECT * FROM users WHERE id != ? AND activation = 1'
    res = database.db_query(sql, array)
    return res