Ejemplo n.º 1
0
def getByBothName(bothname):
    first = bothname[0]
    last = bothname[1]
    user = my_database.queryAll("SELECT * FROM users WHERE first_name LIKE %s and last_name LIKE %s", ('%' + first + '%', '%' + last + '%'))
    return user
Ejemplo n.º 2
0
def getByLastName(lastname):
    user = my_database.queryAll("SELECT * FROM users WHERE last_name LIKE %s", ('%' + lastname + '%',))
    return user
Ejemplo n.º 3
0
def getAllUsers():
    user = my_database.queryAll("SELECT * FROM users","")
    return user
Ejemplo n.º 4
0
def getIdolIdByUsername(username):
    followed_user = my_database.queryAll(
        "SELECT follow.idol FROM follow JOIN users ON follow.follower = users.id WHERE users.username = %s",
        [username])
    return followed_user
Ejemplo n.º 5
0
def getFollower(user_id):
    followed_by_user = my_database.queryAll(
        "SELECT users.id, users.username, users.first_name, users.last_name FROM users JOIN follow ON users.id = follow.follower WHERE follow.idol = %s",
        [user_id])
    return followed_by_user
Ejemplo n.º 6
0
def getIdolId(user_id):
    followed_user = my_database.queryAll(
        "SELECT idol FROM follow WHERE follower = %s", [user_id])
    return followed_user