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
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
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
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
def search(id_user): array = [id_user] sql = 'SELECT * FROM users WHERE id != ? AND activation = 1' res = database.db_query(sql, array) return res