def METHOD_NAME(cls, username):
    """Counts the (int) total number of books logged by this `username`"""
    oldb = db.get_db()
    data = {'username': username}
    query = "SELECT count(*) from booknotes WHERE username=$username"
    return oldb.query(query, vars=data)[0]['count']