def searchGallery(): items = [] user_name = db_helper.getName(request.cookies.get('UserIdCookie')) user_id = request.cookies.get('UserIdCookie') inputs = request.form.getlist('form')[0].split('&') show_name = inputs[0].split('=')[-1] section = inputs[1].split('=')[-1] #print(show_name,section) #print('ssss') items = db_helper.searchGallery(user_id, show_name, section) #print(items) # for item in items: # print(type(item)) # item.add(section) # print(items) keys=('Name','Title_id','Type','Popularity', 'AverageRating','Platform') df = [dict(zip(keys, values)) for values in items] for row in df: row['section'] = section print(df) return renderGallery(user_name, df)
def renderReview(showname,titleid, type_, update_type): print(showname,titleid,type_,update_type) user_name = db_helper.getName(request.cookies.get('UserIdCookie')) return render_template("review.html", username=user_name, showname=showname, titleid=titleid, type=type_, update_type=update_type)
def renderSearched(df, sugg_df): user_name = db_helper.getName(request.cookies.get('UserIdCookie')) return render_template("searched.html", name=user_name, items=df, suggested=sugg_df)
def renderHome(): user_name = db_helper.getName(request.cookies.get('UserIdCookie')) movie_recs = rec.get_recommendation(request.cookies.get('UserIdCookie')) keys=('Name', 'Type', 'Popularity', 'AverageRating','Platform', 'Genre') df = [dict(zip(keys, values)) for values in movie_recs] return render_template("home.html",name=user_name, items=df)
def getGallery(): items = [] user_name = db_helper.getName(request.cookies.get('UserIdCookie')) # inputs = request.form.getlist('form')[0].split('&') # print(inputs) return renderGallery(user_name, items)
def success(name): n = db_helper.getName(name) return render_template('index.html', account=n, user=name, items=db_helper.query_name(name))