Exemple #1
0
def get_student():
    hackbright_app.connect_to_db()
    print request.args
    student_github = request.args.get("github")
    row = hackbright_app.get_student_by_github(student_github)
    html = render_template("student_info.html", first_name = row[0], last_name=row[1], github=row[2])
    return html
Exemple #2
0
def get_student():
    hackbright_app.connect_to_db()
    student_github = request.args.get("github")
    row = hackbright_app.get_student_by_github(student_github)
    row2 = hackbright_app.get_student_report(student_github)

    return render_template("student_info.html", first_name=row[0], last_name=row[1], github=row[2], list_of_grades=row2)
Exemple #3
0
def get_student():
    hackbright_app.connect_to_db()
    student_github = request.args.get("github")
    row = hackbright_app.get_student_by_github(student_github)
    first_name = row[0]
    last_name = row[1]

    grades = hackbright_app.show_grades(first_name,last_name)
    print grades
    # project_names, grades = zip(*grades)

    html = render_template("index.html", first_name = row[0],
                                        last_name = row[1],
                                        github = row[2],
                                        grades = grades
                                        # project_names = project_names
                                        )


# def list_project_grades():
#     hackbright_app



    return html
Exemple #4
0
def get_student():
    hackbright_app.connect_to_db()
    student_github = request.args.get("student")
    row = hackbright_app.get_student_by_github(student_github)
    grade = hackbright_app.show_all_grades(row[0], row[1])
    html = render_template("student_info.html", first_name=row[0], last_name=row[1], github=row[2], grade= grade)
    return html
Exemple #5
0
def get_student():
    hackbright_app.connect_to_db()
    student_github = request.args.get("github")
    row = hackbright_app.get_student_by_github(student_github)
    row2 = hackbright_app.get_student_grades(student_github)
    html = render_template("student_info.html", first_name=row[0], last_name=row[1], github=row[2], project_title=row2[2], grade=row2[3])
    return html
Exemple #6
0
def get_student():
    hackbright_app.connect_to_db()
    student_github = request.args.get("github")
    row = hackbright_app.get_student_by_github(student_github)
    row2 = hackbright_app.show_grade(student_github)
    print "row2 _____!!!___!!__!!__%r" % row2
    html = render_template("student_info.html", first_name=row[0], last_name=row[1], github=row[2], grade=row2[:])
    return html
Exemple #7
0
def get_student():
    hackbright_app.connect_to_db()
    student_github = request.args.get("student") # Change this as appropriate
    row = hackbright_app.get_student_by_github(student_github)
    html = render_template("student_info.html", first_name=row[0],
                                                last_name=row[1],
                                                github=row[2])
    return html
def get_student():
    hackbright_app.connect_to_db()
    student_github = request.args.get("github")
    row = hackbright_app.get_student_by_github(student_github)
    github_only = row[2]
    grades = hackbright_app.grades_by_student(github_only)
    html = render_template("student_info.html", first_name=row[0], last_name=row[1], github=row[2], grades=grades)
    return html
Exemple #9
0
def get_student(): # function name
    hackbright_app.connect_to_db()
    student_github = request.args.get("student") #getting key:value from url
    row = hackbright_app.get_student_by_github(student_github)
    html = render_template("student_info.html", first_name = row[0], # render_template(name_template_file, values_to_fill)
                                                last_name = row[1],
                                                github = row[2])
    return html
Exemple #10
0
def get_student():
    hackbright_app.connect_to_db()
    student_github = request.args.get("github") #fancy dictionary 
    row = hackbright_app.get_student_by_github(student_github)
    grades = hackbright_app.show_all_grades(student_github)
    html = render_template("student_info.html", first_name=row[0], 
        last_name=row[1], github=row[2], grades=grades)
    return html
Exemple #11
0
def get_student():
    hackbright_app.connect_to_db()
    student_github = request.args.get("github")
    row = hackbright_app.get_student_by_github(student_github)
    # row[0] = first name, row[1] = last name
    grades = hackbright_app.show_all_grades(row['firstname'], row['lastname'])
    html = render_template("student_info.html", first_name=row['firstname'], 
                                last_name=row['lastname'], github=row['github'], grades=grades)
    return html
Exemple #12
0
def get_student(student_github=None):
    hackbright_app.connect_to_db()
    if not student_github:
        student_github = request.args.get("github")

    profile = hackbright_app.get_student_by_github(student_github)
    grades = hackbright_app.show_grade(student_github)

    html = render_template("student_info.html", first_name=profile[0], last_name=profile[1], github=profile[2], grades=grades)
    return html
Exemple #13
0
def get_student():
    hackbright_app.connect_to_db()
    student_github = request.args.get("github")
    row = hackbright_app.get_student_by_github(student_github)
    rows = hackbright_app.show_grade(student_github) # list of tuples
    html = render_template("student_info.html", first_name=row[0],
                                                last_name=row[1],
                                                github=row[2],
                                                projects=rows)
    return html
Exemple #14
0
def get_student():
    # let Flask connect to our database
    hackbright_app.connect_to_db()
    student_github = request.args.get("github")
    row = hackbright_app.get_student_by_github(student_github)
    html = render_template("student_info.html",
                           first_name=row[0],
                           last_name=row[1],
                           github=row[2])
    return html
Exemple #15
0
def get_student():
    hackbright_app.connect_to_db()
    student_github = request.args.get("student")
    name = hackbright_app.get_student_by_github(student_github)
    # first_name=name[0]
    # last_name=name[1]
    # github=name[2]
    grades = hackbright_app.student_grades(name[0], name[1])
    html = render_template("student_info.html", first_name=name[0], last_name=name[1], github=name[2], grades=grades)
    return html
Exemple #16
0
def get_student():
    hackbright_app.connect_to_db()
    student_github = request.args.get("github")
    student_name = hackbright_app.get_student_by_github(student_github)
    student_grades = hackbright_app.get_grade_by_student(student_github)
    html = render_template("student_info.html", first_name = student_name[0],
                                                last_name = student_name[1],
                                                github = student_name[2],
                                                projects = student_grades)
    return html
Exemple #17
0
def get_student():
    hackbright_app.connect_to_db()
    student_github = request.args.get("github")
    row = hackbright_app.get_student_by_github(student_github)
    list_of_grades = hackbright_app.get_grade_by_github(student_github)
    html = render_template("student_info.html", first_name=row[0],
                                                last_name=row[1],
                                                github=row[2],
                                                list_of_grades=list_of_grades)

    return html
Exemple #18
0
def get_student():
    hackbright_app.connect_to_db()
    student_github = request.args.get("student")
    row = hackbright_app.get_student_by_github(student_github)
    rows = hackbright_app.get_student_report(student_github)
    html = render_template("student_info.html", first_name = row[0],
                                                last_name = row [1],
                                                github = row[2],
                                                projects = rows
                                                )
    return html
Exemple #19
0
def get_student():
    hackbright_app.connect_to_db()
    student_github = request.args.get("github")
    row = hackbright_app.get_student_by_github(student_github)
    rows = hackbright_app.show_grade(student_github)  # list of tuples
    html = render_template("student_info.html",
                           first_name=row[0],
                           last_name=row[1],
                           github=row[2],
                           projects=rows)
    return html
def get_student_grades():
    hackbright_app.connect_to_db()
    student_github = request.args.get("student")
    student_info = hackbright_app.get_student_by_github(student_github)
    student_grades = hackbright_app.get_student_grades(student_github)
    html = render_template("student_info.html", first_name=student_info[0],
                                                last_name=student_info[1],
                                                github=student_info[2],
                                                project_title=student_grades[0],
                                                grades=student_grades[1])
    return html
Exemple #21
0
def get_student():
    hackbright_app.connect_to_db()
    student_github = request.args.get("github")
    row = hackbright_app.get_student_by_github(student_github)
    student_grades = hackbright_app.get_all_grades(student_github)
    projects = hackbright_app.get_all_projects()
    return render_template("student_info.html", first_name=row[0],
                                                last_name=row[1],
                                                github=row[2],
                                                grades=student_grades,
                                                projects = projects)
Exemple #22
0
def get_student():
    hackbright_app.connect_to_db()
    student_github = request.args.get("github")
    d1 = hackbright_app.get_student_by_github(student_github)
    d2 = hackbright_app.show_all_grades_for_student(d1['first name'])
    html = render_template("student_info.html",
                           first_name=d1['first name'],
                           last_name=d1["last name"],
                           github=d1["github"],
                           project_data=d2)
    return html
Exemple #23
0
def get_student():
    hackbright_app.connect_to_db()
    student_github = request.args.get("github") 
    student = hackbright_app.get_student_by_github(student_github)
    grades = hackbright_app.get_grades_by_student(student_github)
    html = render_template("student_info.html", grades=grades,
                                                first_name=student[0],
                                                last_name=student[1],
                                                student_github=student_github
                                                )
    return html
Exemple #24
0
def get_student():
    hackbright_app.connect_to_db()
    student_github = request.args.get("github")
    student = hackbright_app.get_student_by_github(student_github)
    grades = hackbright_app.show_all_grades_by_github(student_github)
    html = render_template("student_info.html", first_name=student[0],
                                                last_name=student[1],
                                                github=student[2], grades=grades)

    hackbright_app.CONN.close()  #CONN is global
    return html
Exemple #25
0
def get_student_by_github():
    hackbright_app.connect_to_db()
    student_github = request.args.get("github")
    row = hackbright_app.get_student_by_github(student_github)
    grades = hackbright_app.get_all_grades(student_github)

    html = render_template("student_info.html", grade_list=grades,
                                                first_name=row[0],
                                                last_name=row[1],
                                                github=row[2])
    return html
Exemple #26
0
def new_student():
	hackbright_app.connect_to_db()
	first_name = request.args.get("first_name")
	last_name = request.args.get("last_name")
	github = request.args.get("github")
	create = hackbright_app.make_new_student(first_name, last_name, github)
	row = hackbright_app.get_student_by_github(github)
	html = render_template("new_student.html", first_name=row[0], last_name=row[1], 
												github=row[2])

	return html
Exemple #27
0
def get_student():
    hackbright_app.connect_to_db()
    student_github = request.args.get("github")
    row = hackbright_app.get_student_by_github(student_github)
    if row:
        grades = hackbright_app.show_all_student_grades(student_github)
        html = render_template("student_info.html", first_name = row[0],
                                                    last_name = row[1],
                                                    github = row[2],
                                                    grades = grades)
        return html
    else:
        return redirect("/")
def make_student():
    hackbright_app.connect_to_db()
    student_first_name = request.args.get("first_name")
    student_last_name = request.args.get("last_name")
    student_github = request.args.get("github")
    
    hackbright_app.make_new_student(student_first_name, student_last_name, student_github)
    row = hackbright_app.get_student_by_github(student_github)

    html = render_template("student_info.html", first_name=row[0],
                                                last_name=row[1],
                                                github=row[2])
    return html
def get_student():
    hackbright_app.connect_to_db()
    student_github = request.args.get("student")
    row = hackbright_app.get_student_by_github(student_github)
    grades = hackbright_app.show_all_grades(row[0], row[1])

    html = render_template("student_info.html",
                           first_name=row[0],
                           last_name=row[1],
                           github=row[2],
                           grades=grades)

    return html
Exemple #30
0
def get_student():                  # defining handler
    hackbright_app.connect_to_db()  # connects to hackbright.db in current dir
    student_github = request.args.get("github")    # key in url, also the argument for get_s_b_g function
    student_name = hackbright_app.get_student_by_github(student_github)     #returns a single DB row

    if student_name == None:
        #hackbright_app.make_new_student("Jane", "Doe", student_github)
        html = render_template("add_student.html", github=student_github)
    else: 
        grades_list = hackbright_app.grades_by_student(student_name[0], student_name[1])    #returns a list of rows
        html = render_template("student_info.html", first_name=student_name[0], last_name=student_name[1],
            github=student_name[2], grades_list=grades_list)
    return html
Exemple #31
0
def get_student():
    hackbright_app.connect_to_db()
    student_github = request.args.get("github")
    row = hackbright_app.get_student_by_github(student_github)
    grades = hackbright_app.get_all_grades_for_one_student(student_github)
    print "GRADES TO FOLLOW..."
    print grades
    print row
    html = render_template("student_info.html", first_name=row[0],
                                                last_name=row[1],
                                                github=row[2],
                                                grades=grades)
    return html
Exemple #32
0
def get_student():
    hackbright_app.connect_to_db()
    student_github = request.args.get("github")

    row = hackbright_app.get_student_by_github(student_github)
    if not row:
        flash("Please enter a valid student github")
        return redirect("/")
    data = get_all_grades(student_github)
    html = render_template("student_info.html", first_name=row[0],
                                                last_name=row[1],
                                                github=row[2],
                                                grades=data)
    return html
def get_student():
    hackbright_app.connect_to_db()
    github_name = request.args.get("github")

    student = hackbright_app.get_student_by_github(github_name)
    grades = hackbright_app.show_all_grades(github_name)

    html = render_template("student_info.html",
        first_name=student[0],
        last_name=student[1],
        github=student[2],
        grades=grades,
    )
    return html
def get_student():
	"""Gets the student's name and grades by their github account, displays them on a new page"""
	hackbright_app.connect_to_db()

	student_github = request.args.get("github")
	student_info = hackbright_app.get_student_by_github(student_github)
	dict_of_grades = hackbright_app.show_grades(student_github)

	html = render_template('student_info.html', 
		first_name=student_info["first_name"], 
		last_name=student_info["last_name"], 
		github=student_info["github"], 
		projects_and_grades = dict_of_grades)
	return html
Exemple #35
0
def get_student():

    hackbright_app.connect_to_db()
    student_github = request.args.get("poop")
    row = hackbright_app.get_student_by_github(student_github)
    last_name = row[1]
    name_and_grades_raw = hackbright_app.return_student_grades(last_name)   # [ ("proja", "A"), ("projb", "C")]
    name_and_grades = [ {'project_name': x[0], 'grade': x[1]} for x in name_and_grades_raw ]   # [ {'project_name':"proja', 'grade':'A"}]

 #   for grade in grades:

    html =  render_template("student_info.html", first_name = row[0],
                                                last_name = row[1],
                                                github = row[2], name_and_grades = name_and_grades)
    return html
Exemple #36
0
def get_student():
    hackbright_app.connect_to_db()
    student_github = request.args.get("github")
    student_github_tuple = hackbright_app.get_student_by_github(student_github)
    first_name = student_github_tuple[0]
    last_name = student_github_tuple[1]
    github = student_github_tuple[2]
    
    student_grades_list = hackbright_app.get_grades_by_student(first_name,last_name)
    # title = student_grades_tuple[0]
    # grade = student_grades_tuple[1]
    # max_grade = student_grades_tuple[2]

    html = render_template("student_info.html", first_name=first_name,
                                                last_name=last_name,
                                                github=github,
                                                student_grades_list=student_grades_list)
    return html
Exemple #37
0
def get_student():
    hackbright_app.connect_to_db()
    student_github = request.args.get("github")
    row1 = hackbright_app.get_student_by_github(student_github)
    row2 = hackbright_app.query_grades_by_student(row1[1])
    print "********************************************"
    print "this is row 2", row2
    print "********************************************"

    get_grades = []
    get_project = []
    for i in range(len(row2)):
        get_project.append(row2[i][0])
        get_grades.append(row2[i][1])

    html = render_template("student_info.html",
                           first_name=row1[0],
                           last_name=row1[1],
                           github=row1[2],
                           projects=get_project,
                           grades=get_grades)
    return html